I have a router:
match “/person(/:sex)(/:search)” => “person#index”, :constraints => {
:sex => /male|female/ }
And a search form:
<%= form_tag(“/person”, :method => “get”) do %>
<%= search_field_tag(:search, params[:search]) %>
<%= submit_tag(“Search”) %>
<% end %>
But why, after submit form url is:
http://localhost:3000/person?utf8=✓&search=Clinton&commit=Search
And not a:
http://localhost:3000/person/Clinton
or
http://localhost:3000/person/Clinton?utf8=✓&commit=Search
The “sex” is optional value and url should be only
http://localhost:3000/person/Clinton
or