Sha256: 4cd903706fd85c0af0b3909fd08caf510f71f2639adf05fa1c2282bb402d3f2a

Contents?: true

Size: 1.15 KB

Versions: 8

Compression:

Stored size: 1.15 KB

Contents

<div class="field is-horizontal <%= options.delete(:field_class) %>">

  <% if has_label %>
    <div class="field-label <%= options.delete(:field_label_class) || 'is-normal' %>">
      <%- label_options[:class] << ' label' %>
      <%- label_options[:class] << ' required' if options.delete(:required) %>
      <%= label attribute_name, label_text, label_options %>
    </div>
  <% end %>

  <div class="field-body">
    <%#
      Use an extra nested field so the help text appears where expected
      rather than as another addon.
      https://github.com/jgthms/bulma/issues/640#issuecomment-415231212
    %>
    <div class="field">
      <div class="control <%= options.delete(:control_class) %>">
        <%- options[:class] << ' input' %>
        <%- options[:class] << ' is-danger' if errors[attribute_name].present? %>
        <%= text_field attribute_name, options %>
      </div>

      <%- if hint_text.present? %>
        <p class="help"><%= hint_text %></p>
      <%- end %>

      <%- if errors[attribute_name].present? %>
        <p class="help is-danger"><%= errors.full_messages_for(attribute_name).to_sentence %></p>
      <%- end %>
    </div>
  </div>

</div>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
template_form-0.4.10 lib/template_form/templates/bulma_horizontal/date_input.html.erb
template_form-0.4.9 lib/template_form/templates/bulma_horizontal/date_input.html.erb
template_form-0.4.8 lib/template_form/templates/bulma_horizontal/date_input.html.erb
template_form-0.4.7 lib/template_form/templates/bulma_horizontal/date_input.html.erb
template_form-0.4.6 lib/template_form/templates/bulma_horizontal/date_input.html.erb
template_form-0.4.5 lib/template_form/templates/bulma_horizontal/date_input.html.erb
template_form-0.4.4 lib/template_form/templates/bulma_horizontal/date_input.html.erb
template_form-0.4.3 lib/template_form/templates/bulma_horizontal/date_input.html.erb