我使用的搜索框使用以下格式:
<div id='search-box'>
<%= form_tag "/search", :method => :get, :id => "search-form" do %>
<%= text_field_tag :q, params[:q], {:id => "search-text", :placeholder => "SEARCH FOR PRODUCTS"} %>
<%= submit_tag "Go" %>
<%end%>
</div>
问题是每当我在搜索框中输入内容时,它会显示以前查询的下拉列表。我不想存储查询并显示下拉列表。如何清除查询?
答案 0 :(得分:1)
使用autocomplete="off"
:
<%= text_field_tag :q, params[:q], {:id => "search-text", :placeholder => "SEARCH FOR PRODUCTS", :autocomplete => 'off'} %>