/ Published in: Rails
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
==================================================== DATABASE RELATED ==================================================== VERY BEGINNING MySQL DB BASICS 1. Login to MySQL Monitor mysql -u root -p 2. Create the database: create database store_development; create database store_test; create database store_production; 3. Switch to this new database use store_development 4. Create the table: create table items ( id int not null auto_increment, name varchar(80) not null, description text not null, price decimal(8,2) not null, primary key(id) ); 5. Exit MySQL Monitor: exit 6. Configure \config\database.yml accordingly 7. Navigate to the directory of your Rails app (via Terminal) 8. Create a model named Item and a controller named Managed this way: ruby script/generate scaffold Item Manage