Sha256: 27539b81fee9f73bda9ced22d4cb32d54a53c6347b15866e1171366587ee39ec
Contents?: true
Size: 1.68 KB
Versions: 10
Compression:
Stored size: 1.68 KB
Contents
<% # headmin/forms/email # # ==== Options # * <tt>form<tt> - Form object # * <tt>attribute<tt> - Name of the attribute of the form model # * <tt>label<tt> - Text to show as label. Label will be hidden if value is false # * <tt>float<tt> - Set to true if you want to show floating labels # * <tt>append<tt> - Text or icon to be shown on the left hand side of the input, Doesn't work with float # * <tt>prepend<tt> - Text or icon to be shown on the right hand side of the input, Doesn't work with float # # ==== Examples # Basic version # <%= render 'headmin/forms/email', form: form, attribute: :email_address %#> append = local_assigns.has_key?(:append) ? append : nil class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false data = local_assigns.has_key?(:data) ? data : nil disabled = local_assigns.has_key?(:disabled) ? disabled : false float = local_assigns.has_key?(:float) ? float : false label = local_assigns.has_key?(:label) ? label : nil prepend = local_assigns.has_key?(:prepend) ? prepend : nil readonly = local_assigns.has_key?(:readonly) ? readonly : false required = local_assigns.has_key?(:required) ? required : false options = { 'aria-describedby': form_field_validation_id(form, attribute), class: "form-control #{form_field_validation_class(form, attribute)} #{class_names}", data: data, disabled: disabled, placeholder: attribute, readonly: readonly, required: required, } %> <%= render 'headmin/forms/base', form: form, attribute: attribute, append: append, prepend: prepend, float: float, label: label, required: required do |form| %> <%= form.email_field(attribute, options) %> <% end %>
Version data entries
10 entries across 10 versions & 1 rubygems