Created
June 27, 2012 19:16
-
-
Save DanCoughlin/3006125 to your computer and use it in GitHub Desktop.
How to conditionally pass a parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_tag catalog_index_path, :method => :get, :id => "search-form-header" do %> | |
<%= search_as_hidden_fields(:omit_keys => [:q, :search_field, :qt, :page]).html_safe %> | |
<%= text_field_tag :q, params[:q] unless params[:q] == 'dashboard'?, :class => "q", :id => "search-field-header", :placeholder => "Type keywords in here" %> | |
<%= params[:controller] %> | |
<%= submit_tag 'Go', :id=>'search-submit-header' %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment