Hello!
I have a problem I have made a simple search form where you can select
a category, region and enter some free text.
My view looks like this:
<%= form_tag %>
Category: | <%= select(“search_item”, “category”, JobCategory.active_categories.collect {|c| [c.title, c.id]}, { :include_blank => true }) %> |
Region: | <%= select(“search_item”, “region”, Region.active_regions.collect {|r| [r.title, r.id]}, {:include_blank => true } ) %> |
Free text: | <%= text_field(“search_item”,“phrase”, “size” => 40) %> |
… | <%= submit_tag(" Search ") %> |
<%= end_form_tag %>
The search_item is just a simple class with the attributes category,
region and phrase.
Every example I have seen requires to create an object of a model but I
don’t want to do this. I just want the code to fill my search_item
object with the correct values. Any ideas?