Sha256: 4e8c3cb61a37c24a4c6ae3dc69aebe7eb1c2e8b88dfc0c80ec759a3dc5e77ae4
Contents?: true
Size: 881 Bytes
Versions: 7
Compression:
Stored size: 881 Bytes
Contents
<% # headmin/filters/search # # ==== Options # * +name</tt> - Name of the filter parameter # * +label</tt> - Name of the resource to be used in the placeholder (search in ...) # * +placeholder</tt> - Placeholder in the search field # # ==== Examples # Basic version. # <%= render 'headmin/filters/search', name: :search, label: Poll.model_name.human(count: 2) %#> name = local_assigns.has_key?(:name) ? name : :search label = local_assigns.has_key?(:label) ? label : name.to_s.humanize placeholder = local_assigns.has_key?(:placeholder) ? placeholder : t('.placeholder', resource: label) value = filter_param_exists?(name) ? params[name] : nil %> <% content_for :filters_search do %> <input class="form-control" type="search" placeholder="<%= raw placeholder.capitalize %>" aria-label="Search" name="<%= name %>" value="<%= value %>"> <% end %>
Version data entries
7 entries across 7 versions & 1 rubygems