This is the code in the view.
<% form_tag({:controller => 'users',
:action => 'test'}) do %>
<%= text_field_tag(:search_options, params[:search_options])%>
<%= submit_tag("Display text!")%>
<% end -%>
I have a file test.html.erb and have also added get “users/test” to routes.rb still i’m getting Error: No route matches “/users/test”
The
form_tagmethod creates a form to be send using HTTP POST by default. You state that the route you define in yourroutes.rbis a GET. So you have two options to fix this problem:POST "users/test"form_tagcall to:form_tag({:controller => 'users', :action => 'test'}, :method => :get)