I have a simple search form in my Rails 3 app:
<%= form_tag search_path, :method => "get" do %>
<%= text_field_tag :q, params[:q] %>
<%= submit_tag "search", :name => nil %>
<% end %>
When the user hits the submit button, they get taken to the URL: http://myapp.com/search?utf8=%E2%9C%93&q=foobar
(where %E2%9C%93
gets displayed as a checkmark: ?).
I'm not doing anything with the utf8
parameter, so I want to keep the URL clean by removing it entirely. That is, I want users to get taken to the URL: http://myapp.com/search?q=foobar instead.
How do I do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…