Search code examples
ruby-on-railsruby-on-rails-3parameterssimple-form

Remove route name from simple_form params?


Simpleform seems to append the route name to its params hash. How can one prevent or remove it ?

simple_form_for @profile ... 

returns params like:

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

But

simple_form_for profile_path

returns params like:

 params['people/search][:query] 

I want to remove that people/search path but cannot figure out how by any means, anyone knows how to remove it and still use simple_form? thx!


Solution

  • This did the trick:

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