I have a Store model. And two controllers:
- stores_controller
- admin/stores_controller
now in the list view of the admin/stores_controller I am trying to generate a link to the destroy action in the admin/stores_controller but every variation I have tried either goes to the stores_controller (so not the admin one) or to some other incorrect url.
I am currenty using
<%= link_to "Delete", :controller => "admin/stores",
:action => "destroy", :id => store, :method => :delete %>
but this generates a url like http://localhost:3000/admin/stores/5?method=delete which invokes the show action instead of the destroy one.
in routes.rb I have
map.namespace :admin do |admin|
admin.resources :stores
end
map.resources :stores
How do I fix this?