I have a copy of the Rails 1 book. I realize that it is from 2007, and that the Rails 2 book has come out. From what I can tell, the same error applies in the newer version of the book too. I have found several errors so far, but have googled and corrected them all and am currently on page 139. Here is a break down of the problem.
As the book instructed on page 140 I changed story_controller.rb to
class StoryController < ApplicationController
scaffold :story
end
When I then went to http://localhost:3000/story I got:
Routing Error
undefined method `scaffold’ for StoryController:Class
I googled that and found another thread on this forum, here: http://www.sitepoint.com/forums/showthread.php?t=531057
There it was recommended that I read [URL=“http://www.leonardoborges.com/writings/2007/12/21/rails-20-scaffold/”]http://www.leonardoborges.com/writings/2007/12/21/rails-20-scaffold/
which I did.
That explain that we are supposed to now be using:
rails generate scaffold Story name:string email:string
I am still getting the error:
Routing Error
undefined method `scaffold’ for StoryController:Class
Please help me out. I would like to keep moving forward. I can tell that I am learning, but I don’t know enough to get over this hurdle. Thanks!!!