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_开发者_如何学Cprice, params[:max_price], :size => 4 %>
Check out rake routes
, it'll show all the named paths available to you.
I do rake routes | grep <something>
pretty much daily.
You probably want searches_path()
for what you're thinking.
精彩评论