Sha256: 7e2592128e9ad6861749a2111a1e6d56c9e7be96ef675298480bbb3f7894bfdf

Contents?: true

Size: 1.22 KB

Versions: 16

Compression:

Stored size: 1.22 KB

Contents

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

  color = Formstrap::ColorView.new(local_assigns)
%>

<%= render "formstrap/wrapper", color.wrapper_options do %>
  <%= render "formstrap/label", color.label_options if color.label? %>
  <%= form.color_field(color.attribute, color.input_options) %>
  <%= render "formstrap/validation", color.validation_options if color.validate? %>
  <%= render "formstrap/hint", color.hint_options if color.hint? %>
<% end %>

Version data entries

16 entries across 16 versions & 1 rubygems

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