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
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:
- script/generate controller Products
- script/generate model Products
- rake db:migrate
- modified products_controller.rb to add: def index() { @products = Product.all}
- (error: uninitialized constant ProductsController::Product)
- ideally, dump all orders in the view
What's the fix?
© Stack Overflow or respective owner