Sha256: 227f7959bad0db3242dc9d0512f1d2c3624fdafb05eee9bf4d4ce153b157ff88

Contents?: true

Size: 1.7 KB

Versions: 5

Compression:

Stored size: 1.7 KB

Contents

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

  textarea = Headmin::Form::TextareaView.new(local_assigns)
%>

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
headmin-0.5.1 app/views/headmin/forms/_textarea.html.erb
headmin-0.5.0 app/views/headmin/forms/_textarea.html.erb
headmin-0.4.2 app/views/headmin/forms/_textarea.html.erb
headmin-0.4.1 app/views/headmin/forms/_textarea.html.erb
headmin-0.4.0 app/views/headmin/forms/_textarea.html.erb