Sha256: 6b152562e473caa9644ef58cc3e673cd4d2085b496c8b02b38ae94cd6b75a0cd

Contents?: true

Size: 1.75 KB

Versions: 16

Compression:

Stored size: 1.75 KB

Contents

<%
  # formstrap/date
  #
  # ==== Required parameters
  # * +attribute+ - Name of the attribute of the form model
  # * +form+ - Form object
  #
  # ==== Optional parameters
  # * +append+ - Display as input group with text on the right-hand side
  # * +float+ - Use floating labels. Defaults to false
  # * +hint+ - Informative text to assist with data input. HTML markup is allowed.
  # * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label.
  # * +list+ - Options are passed through options_for_select
  # * +plaintext+ - Render input as plain text.
  # * +prepend+ - Display as input group with text on the left-hand side
  # * +wrapper+ - Hash with all options for the surrounding html tag
  #
  # ==== References
  # https://headmin.dev/docs/forms/date
  # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
  # https://apidock.com/rails/ActionView/Helpers/FormHelper/date_field
  #
  # ==== Examples
  #   Basic version
  #   <%= form_with do |form| %#>
  #     <%= render "formstrap/date", form: form, attribute: :date_of_birth %#>
  #   <% end %#>

  date = Formstrap::DateView.new(local_assigns)
%>

<%= render "formstrap/wrapper", date.wrapper_options do %>
  <%= render "formstrap/label", date.label_options if date.prepend_label? %>
  <%= render "formstrap/input_group", date.input_group_options do %>
    <%= form.date_field(date.attribute, date.input_options) %>
    <%= render "formstrap/datalist", date.datalist_options if date.datalist? %>
  <% end %>
  <%= render "formstrap/validation", date.validation_options if date.validate? %>
  <%= render "formstrap/hint", date.hint_options if date.hint? %>
  <%= render "formstrap/label", date.label_options if date.append_label? %>
<% end %>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
formstrap-0.4.5 app/views/formstrap/_date.html.erb
formstrap-0.4.4 app/views/formstrap/_date.html.erb
formstrap-0.4.3 app/views/formstrap/_date.html.erb
formstrap-0.4.2 app/views/formstrap/_date.html.erb
formstrap-0.3.5 app/views/formstrap/_date.html.erb
formstrap-0.3.4 app/views/formstrap/_date.html.erb
formstrap-0.3.3 app/views/formstrap/_date.html.erb
formstrap-0.3.2 app/views/formstrap/_date.html.erb
formstrap-0.3.1 app/views/formstrap/_date.html.erb
formstrap-0.3.0 app/views/formstrap/_date.html.erb
formstrap-0.2.1 app/views/formstrap/_date.html.erb
formstrap-0.2.0 app/views/formstrap/_date.html.erb
formstrap-0.1.3 app/views/formstrap/_date.html.erb
formstrap-0.1.2 app/views/formstrap/_date.html.erb
formstrap-0.1.1 app/views/formstrap/_date.html.erb
formstrap-0.1.0 app/views/formstrap/_date.html.erb