Problem with scaffold

Hello,
'm new to Rails…
'm using Agile Web D. with Rails as a reference book.

I have a table named products and a model named product

I used following code in a controller admin

class AdminController < ApplicationController
scaffold :product
end

when I start server and navigate to the url http://localhost:3000/admin,
I get follow error…

NoMethodError in AdminController#index

undefined method `scaffold’ for AdminController:Class

this means I 've not defined an INDEX Method in controller… but the
book doesnt say anything regarding this…
Does that mean “scaffold” handles everything?

Any clue to this problem???

Thanks :slight_smile:

http://tpope.us/rubyonrailsfaq.html

On Thu, May 8, 2008 at 3:30 PM, Ashit V. [email protected] wrote:

   scaffold :product

this means I 've not defined an INDEX Method in controller… but the
book doesnt say anything regarding this…
Does that mean “scaffold” handles everything?

Any clue to this problem???

Thanks :slight_smile:


Ryan B.

Feel free to add me to MSN and/or GTalk as this email.

Hello Ashit,

class AdminController < ApplicationController
scaffold :product
end

what u tried to create using the above code and also i think u can
access my
giving

http://localhost:3000/product http://localhost:3000/admin, rite?

regards,
sumesh

Sumesh S wrote:

Hello Ashit,

class AdminController < ApplicationController
scaffold :product
end

what u tried to create using the above code and also i think u can
access my
giving

http://localhost:3000/product http://localhost:3000/admin, rite?

regards,
sumesh

I encounter the same problem while reading books agile web dev.I think u
try
script/generate scaffold model attribute:datatype