form_tag for search model

Posted by kip on Stack Overflow See other posts from Stack Overflow or by kip
Published on 2010-03-30T01:26:25Z Indexed on 2010/03/30 1:33 UTC
Read the original article Hit count: 438

Filed under:

I have a search controller which is to be used to search over a separate model called house. The house model has a restful setup. I want the results listed on the index action of the search controller. The form_tag url is giving me some problems. What is the correct path for this?

Below is the search form (search/form):

 <% form_tag index_search do -%>
  <p>
<%= collection_select(:house, :category_id, Category.all, :id, :name) %>
</p>
<p>
 <strong>price</strong><br />

<%= text_field_tag :min_price, params[:min_price], :size => 3 %>
<%= text_field_tag :max_price, params[:max_price], :size => 4 %>

© Stack Overflow or respective owner

Related posts about ruby-on-rails