How do I specify an action on a resource in a namespace in rails 3?
Posted
by harald
on Stack Overflow
See other posts from Stack Overflow
or by harald
Published on 2010-05-17T17:02:04Z
Indexed on
2010/05/19
6:20 UTC
Read the original article
Hit count: 553
I have a resource :products in a namespace :shop, like this:
namespace :shop do
resources :products
root :to => 'products#index'
end
When running rake routes
it outputs the following:
edit_shop_product GET /shop/products/:id/edit(.:format) {:action=>"edit", :controller=>"shop/products"}
But when I use the edit_shop_product_path
in a partial view, like this:
<%= button_to "Edit", edit_shop_product_path(product) %>
I get an ActionController Exception: No route matches "/shop/products/1/edit"
What am I missing?
© Stack Overflow or respective owner