Skip to content

Instantly share code, notes, and snippets.

@speedracr
Created June 23, 2017 13:57
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 speedracr/af50d364aaaedef5a6f6b7b14249df38 to your computer and use it in GitHub Desktop.
Save speedracr/af50d364aaaedef5a6f6b7b14249df38 to your computer and use it in GitHub Desktop.
Rails search field
<%= form_tag('/search', local: true, method: :get, class: 'form-inline' ) do %>
<%= text_field_tag(:q, nil, data: { behavior: 'autocomplete' }, placeholder: 'Search', class: 'form-control mr-sm-2') %>
<%= button_tag('Search', class: 'btn btn-outline-success my-2 my-sm-0', type: 'submit') %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment