Code:
ruby script/generate scaffold Admin::Product
ruby script/generate scaffold Admin::Category
This will create the namespace/directory structure you want. If you want to have the 5-product listing in /admin/, then I suggest editing routes.rb to point to a view/controller method from the Admin::Product controller (since it's really a product page).
As for your second question, you can either accept the defaults and change the file names/controller methods afterwards, or you can run a command like so:
Code:
ruby script/generate controller Product delete_product new_product
Which will make your Product controller with 2 methods, delete_product and new_product. Then you create the views to go with these methods yourself.
Bookmarks