Sha256: 0af1327ce2b3cd9914b8e4f3333dfb14caccafbb4b5afa181ebbeeb71562db82

Contents?: true

Size: 1.56 KB

Versions: 4

Compression:

Stored size: 1.56 KB

Contents

<%
  # headmin/forms/date
  #
  # ==== Required parameters
  # * +form+ - Form object
  # * +attribute+ - Name of the attribute of the form model
  #
  # ==== Optional parameters
  # * +aria+ - Provide a hash to define all aria attributes
  # * +autocomplete+ - Value to be autofilled by the browser
  # * +autofocus+ - Set to true to focus on this field when the page renders
  # * +data+ - Optional HTML data attributes
  # * +disabled+ - Set to true if the input should be shown as disabled
  # * +id+ - Input identifier
  # * +list+ - Add array of options to show in a data list
  # * +readonly+ - Set to true if the value of the field can only be read and not be modified
  # * +required+ - Set to true to mark as required
  # * +step+ - The acceptable value granularity
  # * +value+ - Overrides the value of the form
  #
  # ==== Extra parameters
  # Listed in 'headmin/forms/base'
  #
  # ==== References
  # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
  # https://apidock.com/rails/ActionView/Helpers/FormHelper/date_field
  #
  # ==== Examples
  #   Basic version
  #   <%= render 'headmin/forms/date', form: form, attribute: :date %#>

  option_keys = %i(aria autocomplete autofocus data disabled id list readonly required step value)
  options = local_assigns.slice(*option_keys).merge(
    aria: { describedby: form_field_validation_id(form, attribute) },
    class: ['form-control', form_field_validation_class(form, attribute)].join(' '),
  )
%>

<%= render 'headmin/forms/base', local_assigns do |form| %>
  <%= form.date_field(attribute, options) %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
headmin-0.3.4 app/views/headmin/forms/_date.html.erb
headmin-0.3.3 app/views/headmin/forms/_date.html.erb
headmin-0.3.2 app/views/headmin/forms/_date.html.erb
headmin-0.3.1 app/views/headmin/forms/_date.html.erb