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

Version Path
headmin-0.2.9 app/views/headmin/forms/_email.html.erb
headmin-0.2.8 app/views/headmin/forms/_email.html.erb
headmin-0.2.7 app/views/headmin/forms/_email.html.erb
headmin-0.2.6 app/views/headmin/forms/_email.html.erb
headmin-0.2.5 app/views/headmin/forms/_email.html.erb
headmin-0.2.4 app/views/headmin/forms/_email.html.erb
headmin-0.2.3 app/views/headmin/forms/_email.html.erb
headmin-0.2.2 app/views/headmin/forms/_email.html.erb
headmin-0.2.1 app/views/headmin/forms/_email.html.erb
headmin-0.2.0 app/views/headmin/forms/_email.html.erb