Return to Snippet

Revision: 3044
at May 25, 2007 16:24 by jpowell


Initial Code
	====================================================
	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

Initial URL

                                

Initial Description

                                

Initial Title
Database Model Controller Scaffolding Basics

Initial Tags
mysql, database, textmate, rails

Initial Language
Rails