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


#1

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


#2

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


#3

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

phill


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails