Rails 3 UTF-8 query string showing up in URL?

前端 未结 4 777
你的背包
你的背包 2020-11-30 07:37

I have a search query form on my home page (/)

<% form_tag(search_path, :method => :get) do %>
  <%= text_field_tag \'query\' %>
  <%= subm         


        
4条回答
  •  春和景丽
    2020-11-30 07:49

    I think everyone did a great job explaining why it exists, but I feel like the question wasn't answered, which was:

    How can I get rid of it?

    So everything said is correct, you do need it present to help with "IE" but the reason why it shows up in your address bar is because you are doing a "GET" as opposed to a "POST". Make it a post and it's gone, but then you are also not following convention.

    It comes down to which of these are most acceptable to you.

提交回复
热议问题