Skip to content

Instantly share code, notes, and snippets.

@rsl
Created July 17, 2014 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsl/f879aab2bed11bca27a7 to your computer and use it in GitHub Desktop.
Save rsl/f879aab2bed11bca27a7 to your computer and use it in GitHub Desktop.
don't conditionally set "display: none" as style. set a conditional class and leverage nested SCSS rules.
#survey_search {
&.hide {
display: none;
}
// Other rules
}
<%= form_tag({}, id: 'survey_search', class: params[:query].present? ? 'show' : 'hide') do %>
Some HTML
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment