Sha256: d8350b8068895f94663b4b2a4ba128c6a1670dfb6b392fc404fd760c66721bd2
Contents?: true
Size: 1.18 KB
Versions: 4
Compression:
Stored size: 1.18 KB
Contents
<% # locals: { # search_object: "the object to build the search form for", # search_field: "search input field name", # } %> <%= search_form_for adapt_route_args(search_object), class: "d-inline", html: { data: { controller: "form", turbo_frame: nil } } do |f| %> <label for="search" class="visually-hidden">Search</label> <% if search_field.present? %> <%= f.search_field search_field, id: "search", class: "form-control form-control-sm d-inline w-auto", # since ransack trims strings, we instead # use the url param because it preserves trailing spaces # that way, when the frame reloads the user gets to continue typing value: params[:q].try(:[], search_field), placeholder: "search...", data: { action: "form#submit", form_target: "focus" } %> <% end %> <%# preserve sorting %> <%= f.hidden_field :s, value: params[:q].try(:[], :s) %> <% end %>
Version data entries
4 entries across 4 versions & 1 rubygems