Trying to manually recreate a simple generate/scaffolding script

Posted by montooner on Stack Overflow See other posts from Stack Overflow or by montooner
Published on 2010-06-16T00:14:35Z Indexed on 2010/06/16 0:32 UTC
Read the original article Hit count: 390

Filed under:
|
|
|

I'm trying to understand Rails from the ground up. I want to learn how to manually create basic show-all/show-single/CRUD functionality in the framework.

I currently am working on the display-all functionality, but am stopped by an error when I try to request all items in the Products db

Here are the steps I've taken so far:

  1. script/generate controller Products
  2. script/generate model Products
  3. rake db:migrate
  4. modified products_controller.rb to add: def index() { @products = Product.all}
  5. (error: uninitialized constant ProductsController::Product)
  6. ideally, dump all orders in the view

What's the fix?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby