Question

How do I add display:none to this form?

<%= form_tag(posts_path, :method => "get", id: "search-form", class: "nav-search-wrapper") do %>
    <%= text_field_tag :search, params[:search], placeholder: "Search" %>
    <%= submit_tag "Search", :name => nil %>
<% end %>
Était-ce utile?

La solution

Use style: 'display: none;':

<%= form_tag(posts_path, :method => "get", id: "search-form", class: "nav-search-wrapper", 
    style: "display:none;") do %>
...
<% end %>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top