Sha256: 122de0df125cece56173aa34f7b0de272715dbc7569099c474f15652799eac13

Contents?: true

Size: 876 Bytes

Versions: 10

Compression:

Stored size: 876 Bytes

Contents

<%
  # headmin/filters/search
  #
  # ==== Options
  # * <tt>name</tt> - Name of the filter parameter
  # * <tt>label</tt> - Name of the resource to be used in the placeholder (search in ...)
  # * <tt>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 : nil
  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

10 entries across 10 versions & 1 rubygems

Version Path
headmin-0.2.9 app/views/headmin/filters/_search.html.erb
headmin-0.2.8 app/views/headmin/filters/_search.html.erb
headmin-0.2.7 app/views/headmin/filters/_search.html.erb
headmin-0.2.6 app/views/headmin/filters/_search.html.erb
headmin-0.2.5 app/views/headmin/filters/_search.html.erb
headmin-0.2.4 app/views/headmin/filters/_search.html.erb
headmin-0.2.3 app/views/headmin/filters/_search.html.erb
headmin-0.2.2 app/views/headmin/filters/_search.html.erb
headmin-0.2.1 app/views/headmin/filters/_search.html.erb
headmin-0.2.0 app/views/headmin/filters/_search.html.erb