I've started using the metasearch gem http://metautonomo.us/projects/metasearch/ for a ruby on rails 3 app after seeing it recommended in another stackoverflow post. I would like to have a single text field on a search form that can search in multiple fields rather than have one text field for each. I just havn't been able to figure it out.
My example below is probably a little more complicated because it also uses Multi-level associations:
Model: Report belongs to site
Model: Site has many reports
View (the index for reports with a search form):
Have something like:
<%= f.text_field :site_name_or_site_address_contains %>
rather than 2 seperate text fields like:
<%= f.text_field :site_name_contains %>
<%= f.text_field :site_address_contains %>
The notes on the website and rdocs cover adding new where statements in the initializer. I'm not sure if thats required but I don't really understand them either.