从simple_form params中删除路由名称?

时间:2012-08-31 15:09:30

标签: ruby-on-rails ruby-on-rails-3 params simple-form

Simpleform似乎将路由名称附加到其params散列。如何预防或删除它?

simple_form_for @profile ... 

返回params,如:

Parameters: {"utf8"=>"✓", "query"=>"" ...

但是

simple_form_for profile_path

返回params,如:

 params['people/search][:query] 

我想删除那些人/搜索路径,但无法弄清楚如何以任何方式,任何人都知道如何删除它仍然使用simple_form? THX!

1 个答案:

答案 0 :(得分:1)

这就是诀窍:

  = simple_form_for  :people,  :url => request.fullpath, :method => :get,  :html => { :class => 'form-search' } do |f|