Jonas Knipper

Joined

920 Experience
9 Lessons Completed
0 Questions Solved

Activity

Posted in Global Autocomplete Search Discussion

Had the same issue and rewrote the form_tag, for code see my comment above

Posted in Global Autocomplete Search Discussion

For anyone on Rails <5.1, this example code for `form_tag` can be used to replace `form_with`:

<%= 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 %>

or more readable as GitHub gist: https://gist.github.com/spe...