create a rails project called student with mysql as database (default is sqllite)
rails -d mysql student
vim config/database.yml and edit username/password if required
create the database if not already created through backend
rake db:create:all
Generate a scaffold for a student
ruby script/generate scaffold studen name:string address:string
edit db/migrate/001_create_students.rb to add more tables or columns to existing table. This step can be skipped.
Create the Database tables
rake db:migrate
Run server
ruby scripts\server
Access the project through a browser
http://localhost:3000/students
tada
Showing posts with label rails. Show all posts
Showing posts with label rails. Show all posts
Thursday, March 6, 2008
Subscribe to:
Posts (Atom)