Question

I'm working on rails 3.1.1 and ree-1.8.7 with meta_search 1.1.1 gem.

I would like to know if there is any way to rename the :search param of MetaSearch :

the controller:

User.metasearch(params[:search])

the search form view:

= form_for @users_search, :url => users_path, :html => {:method => :get} do |f|
  = f.label :name_contains
  = f.text_field :name_contains
  = f.submit

I need to do this because it interferes with another text field of the page.

Was it helpful?

Solution

There is an "as" option you can pass.

form_for @users_search, :as => 'q', :url => users_path, :html => {:method => :get} do |f|

Check out form_for documentation for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top