Trying to manually recreate a simple generate/scaffolding script
- by montooner
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?