删除"utf8 =✓"从Rails 3表单提交 [英] Removing "utf8=✓" from Rails 3 form submissions
问题描述
我在Rails 3应用程序中有一个简单的搜索表单:
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: ✓).
我没有对utf8
参数做任何事情,因此我想通过完全删除URL来保持URL干净.也就是说,我希望用户进入以下URL: http://myapp.com/search?q= foobar .
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.
我该怎么做?
推荐答案
即使您没有对参数做任何事情,Rails也是.这是为了纠正IE参数编码中的某些问题. Yehuda在这里有更多信息:
Even though you aren't doing anything with the parameter, Rails is. It's to correct some issues in IE's parameter encoding. Yehuda has more info here:
什么是_snowman参数在Ruby on Rails 3表单中使用?
这篇关于删除"utf8 =✓"从Rails 3表单提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!