Sha256: 16f2046f939bdfd6a25a9fbb876bf1b22ea32f9fd4b142151d1f585ee148a212

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

<%
  # headmin/forms/checkbox
  #
  # ==== Required parameters
  # * +attribute+ - Name of the attribute of the form model
  # * +form+ - Form object
  #
  # ==== Optional parameters
  # * +checked_value+ - Value for checked state
  # * +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.
  # * +unchecked_value+ - Value for unchecked state
  # * +wrapper+ - Hash with all options for the surrounding html tag
  #
  # ==== References
  # https://headmin.dev/docs/forms/checkbox
  # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
  # https://apidock.com/rails/ActionView/Helpers/FormHelper/check_box
  #
  # ==== Examples
  #   Basic version
  #   <%= form_with do |form| %#>
  #     <%= render "headmin/forms/checkbox", form: form, attribute: :active %#>
  #   <% end %#>

  checkbox = Headmin::Form::CheckboxView.new(local_assigns)
%>

<%= render "headmin/forms/wrapper", checkbox.wrapper_options do %>
  <%= form.check_box(checkbox.attribute, checkbox.input_options, checkbox.checked_value, checkbox.unchecked_value) %>
  <%= render "headmin/forms/label", checkbox.label_options if checkbox.label? %>
  <%= render "headmin/forms/validation", checkbox.validation_options if checkbox.validate? %>
  <%= render "headmin/forms/hint", checkbox.hint_options if checkbox.hint? %>
<% end %>

Version data entries

16 entries across 16 versions & 1 rubygems

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