Simple_form: SimpleForm with NameSpace

Created on 30 Oct 2011  路  2Comments  路  Source: heartcombo/simple_form

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.

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.

All 2 comments

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?

Was this page helpful?
0 / 5 - 0 ratings