i use
rails g scaffold_controller admin/sub/Product name:string
to generate crud page,
now i need write route.rb file to map the admin_sub_product_controller,how to write this route file on rails3?
it's hard for me to write 2 level namespace mapping route
namespace admin do
resource :products
end
this only wokrs for /admin/products,but for mapping admin/sub/proudcts how to write?
namespace :admin do
namespace :sub do
resources :products
end
end
rake routes
admin_sub_products GET /admin/sub/products(.:format) {:action=>"index", :controller=>"admin/sub/products"}
POST /admin/sub/products(.:format) {:action=>"create", :controller=>"admin/sub/products"}
new_admin_sub_product GET /admin/sub/products/new(.:format) {:action=>"new", :controller=>"admin/sub/products"}
edit_admin_sub_product GET /admin/sub/products/:id/edit(.:format) {:action=>"edit", :controller=>"admin/sub/products"}
admin_sub_product GET /admin/sub/products/:id(.:format) {:action=>"show", :controller=>"admin/sub/products"}
PUT /admin/sub/products/:id(.:format) {:action=>"update", :controller=>"admin/sub/products"}
DELETE /admin/sub/products/:id(.:format) {:action=>"destroy", :controller=>"admin/sub/products"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With