I have a namespaced admin controller
controllers/admin/products
In the admin view (views/admin/_form.html.erb ) for add products, I use
<%= simple_form_for @product, :validate=>true, :html => {:multipart => true} do |f| %>
...
<%>
In the routes, I have
namespace :admin do
resources :products
end
but the view fails with the error
No route matches {:controller=>"products}
What should I specify in simple_form_for so that the proper post/put route is generated ?
Note that I am using the same partial for new and edit products.
This is not a simple form issue. It simply works as Rails forms and you need to do: simple_form_for [:admin, @product]. Also, please use the mailing list for questions, the issues tracker is for issues.
What about if I have multiple parameters I need to pass in?
Most helpful comment
This is not a simple form issue. It simply works as Rails forms and you need to do:
simple_form_for [:admin, @product]. Also, please use the mailing list for questions, the issues tracker is for issues.