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 %>
<table>
<tr>
<td>Category:</td>
<td><%= select("search_item", "category",
JobCategory.active_categories.collect {|c| [c.title, c.id]}, {
:include_blank => true }) %></td>
</tr>
<tr>
<td>Region:</td>
<td> <%= select("search_item", "region",
Region.active_regions.collect {|r| [r.title, r.id]}, {:include_blank =>
true } ) %></td>
</tr>
<tr valign="top">
<td>Free text:</td>
<td><%=
text_field("search_item","phrase", "size" =>
40)
%></td>
</tr>
<tr>
<td>...</td>
<td><%= submit_tag(" Search ") %></td>
</tr>
</table>
<%= 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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---