Thursday, March 6, 2008

Getting Started with Rails 2.0 on ruby

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

2 comments:

Epiphany said...

Phabi ko kahe involve kar riya hai bhaiya??? :D

sandeep said...

@epiphany : ab to completely involve ho gaya hoon phai .. shaadi ho gayi hai usse