I am following the tutorial at: http://www.onlamp.com/pub/a/onlamp/2006/12/14/revisiting-ruby-on-rails-revisited.html, which has been written for Rails 1.2.6. My environment thou is Rails 2.0. So, here are the steps I followed:
- cd ~/Rails
 - rails cookbook2
 - cd cookbook2
 - rake db:create:all
 - ./script/generate scaffold Category name:string
 - rake db:migrate
 - ./script/server
 
- Go to file config/routes.rb and file the following line:
 
map.root :controller=> 'categories'
map.resources :categories
Now point your browser to http://localhost:3000/categories, and you are ready to create categories!
Creating the recipe table
- ./script/generate scaffold Recipe category:references title:string description:string instructions:text
 - rake db:migrate
 
No comments:
Post a Comment