My form tag in my view:
<%= form_tag view_all_rater_path, :method => 'get' do %>
<p>
<%= text_field_tag :search, params[:search], :placeholder => 'Search by Set # or date' %></br>
<%= submit_tag "Search", :class => "btn btn-link", :name => nil %>
</p>
<% end %>
My controller action:
def view_all
if params[:search]
@ratings = RatingSet.find(:all, :conditions => ['id = ? or rating_date like ?', "%#{params[:search]}%"])
else
@ratings = RatingSet.all
end
end
My routes:
resources :rater, :only => [:index] do
collection do
get :rater_csv
get :view_all
end
end
When I navigate to /rater/view_all I get a No route matches {:action=>"view_all", :controller=>"rater"}