Sha256: 44f0beae96c5b1c3977f5dc2110a278a77ebcc6495540fe3551b97009929c1bf

Contents?: true

Size: 1.98 KB

Versions: 16

Compression:

Stored size: 1.98 KB

Contents

<%
  # headmin/forms/text
  #
  # ==== 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
  # * +collection+ - Values to be suggested while typing. Can be an collection array or a remote URL.
  # * +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/text
  # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
  # https://apidock.com/rails/ActionView/Helpers/FormHelper/text_field
  #
  # ==== Examples
  #   Basic version
  #   <%= form_with do |form| %#>
  #     <%= render "headmin/forms/text", form: form, attribute: :title %#>
  #   <% end %#>

  text = Headmin::Form::TextView.new(local_assigns)
%>

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

Version data entries

16 entries across 16 versions & 1 rubygems

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