Sha256: 02784b5a50ec78d8c610840e7c5a8a7a051c9b97c3d8868cb2ed3c55a5b3dcc2

Contents?: true

Size: 1.83 KB

Versions: 16

Compression:

Stored size: 1.83 KB

Contents

<%
  # headmin/forms/number
  #
  # ==== 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/number
  # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
  # https://apidock.com/rails/ActionView/Helpers/FormHelper/number_field
  #
  # ==== Examples
  #   Basic version
  #   <%= form_with do |form| %#>
  #     <%= render "headmin/forms/number", form: form, attribute: :number %#>
  #   <% end %#>

  number = Headmin::Form::NumberView.new(local_assigns)
%>

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
headmin-0.6.3 app/views/headmin/forms/_number.html.erb
headmin-0.6.2 app/views/headmin/forms/_number.html.erb
headmin-0.6.1 app/views/headmin/forms/_number.html.erb
headmin-0.6.0 app/views/headmin/forms/_number.html.erb
headmin-0.5.9 app/views/headmin/forms/_number.html.erb
headmin-0.5.8 app/views/headmin/forms/_number.html.erb
headmin-0.5.7 app/views/headmin/forms/_number.html.erb
headmin-0.5.6 app/views/headmin/forms/_number.html.erb
headmin-0.5.5 app/views/headmin/forms/_number.html.erb
headmin-0.5.4 app/views/headmin/forms/_number.html.erb
headmin-0.5.3 app/views/headmin/forms/_number.html.erb
headmin-0.5.1 app/views/headmin/forms/_number.html.erb
headmin-0.5.0 app/views/headmin/forms/_number.html.erb
headmin-0.4.2 app/views/headmin/forms/_number.html.erb
headmin-0.4.1 app/views/headmin/forms/_number.html.erb
headmin-0.4.0 app/views/headmin/forms/_number.html.erb