Phillip Novess
2006-Apr-03 19:32 UTC
[Rails] undefined method `scaffold'' for #<LocationsController:0xb7a9e858>
Would anybody know why I get this error from this bit of code: class LocationsController < ApplicationController def index scaffold :locations end end This is the way that is demonstrated in the screencast for creating a quick scaffold. I have done this before. However, I come back to working with Ruby after about a month on something else and now it gives this error. Any thoughts? Thanks, phill
Bill Walton
2006-Apr-03 19:51 UTC
[Rails] undefined method `scaffold'' for#<LocationsController:0xb7a9e858>
Hi Phillip, I''m sure I''d screw up the explanation of why, and hope someone who knows more will illuminate for both of us, but I believe the scaffold directive needs to go outside your action methods like so. class LocationsController < ApplicationController scaffold :locations def index # produce data for index.rhtml to present end end ----- Original Message ----- From: "Phillip Novess" <pnovess@mac.com> To: <rails@lists.rubyonrails.org> Sent: 2006-04-03 2:31 PM Subject: [Rails] undefined method `scaffold'' for#<LocationsController:0xb7a9e858>> Would anybody know why I get this error from this bit of code: > > > class LocationsController < ApplicationController > > def index > scaffold :locations > end > > end > > > > This is the way that is demonstrated in the screencast for creating a > quick scaffold. I have done this before. However, I come back to > working with Ruby after about a month on something else and now it > gives this error. > > Any thoughts? > > Thanks, > phill > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Phillip Novess
2006-Apr-03 22:02 UTC
[Rails] undefined method `scaffold'' for#<LocationsController:0xb7a9e858>
Thanks that was it. How obvious? Thanks, Phill On Apr 3, 2006, at 1:36 PM, Bill Walton wrote: Hi Phillip, I''m sure I''d screw up the explanation of why, and hope someone who knows more will illuminate for both of us, but I believe the scaffold directive needs to go outside your action methods like so. class LocationsController < ApplicationController scaffold :locations def index # produce data for index.rhtml to present end end ----- Original Message ----- From: "Phillip Novess" <pnovess@mac.com> To: <rails@lists.rubyonrails.org> Sent: 2006-04-03 2:31 PM Subject: [Rails] undefined method `scaffold'' for#<LocationsController:0xb7a9e858>> Would anybody know why I get this error from this bit of code: > > > class LocationsController < ApplicationController > > def index > scaffold :locations > end > > end > > > > This is the way that is demonstrated in the screencast for creating a > quick scaffold. I have done this before. However, I come back to > working with Ruby after about a month on something else and now it > gives this error. > > Any thoughts? > > Thanks, > phill > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails