Undefined method `scaffold' for #<LocationsController:0xb7a9

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

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” [email protected]
To: [email protected]
Sent: 2006-04-03 2:31 PM
Subject: [Rails] undefined method `scaffold’
for#LocationsController:0xb7a9e858

Thanks that was it. How obvious?

Thanks,
Phill

On Apr 3, 2006, at 1:36 PM, Bill W. 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” [email protected]
To: [email protected]
Sent: 2006-04-03 2:31 PM
Subject: [Rails] undefined method `scaffold’
for#LocationsController:0xb7a9e858

phill


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs