Forum: Ruby on Rails undefined method `scaffold' for #<LocationsController:0xb7a9

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6a657bbaaa704aa1fc7dfa6d680c06fc?d=identicon&s=25 Phillip Novess (Guest)
on 2006-04-03 21:33
(Received via mailing list)
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
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2006-04-03 21:55
(Received via mailing list)
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>
6a657bbaaa704aa1fc7dfa6d680c06fc?d=identicon&s=25 Phillip Novess (Guest)
on 2006-04-04 00:04
(Received via mailing list)
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>


>
> 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
This topic is locked and can not be replied to.