Within a category, "Seach all posts" checkbox, how to?
- by benoror
Hi, I have set up my routes so I can search all posts with:
/posts/search/foobar
or search inside a category
/posts/category/1/search/foobar
It works pretty well, when someone is browsing an specific category it does search just posts that belongs to that category.
When inside a category, I want to place a checkbox to "Search all the posts"
My search form:
<% form_for :posts, :url => {:controller => :posts, :action => :index} do |f| %>
Search: <%= f.text_field :search %>
<% if params[:cat] %>
<%= f.check_box :ignore_cat, '1', false %> Search all the posts?
<% end %>
<%= f.submit 'Go' %>
<% end %>
How can I force to change the route?