Sha256: 9afb1fc5b1cfcc24598b2642f07815bbe59df14c7bed07e66abea827e9b8f595

Contents?: true

Size: 1.24 KB

Versions: 15

Compression:

Stored size: 1.24 KB

Contents

<% if options.key?(:option_groups) %>
  <% options[:option_groups].each do |group_title, group, group_options| %>
    <div class="p-3">
      <a name="<%= ActiveElement::Components::Util::I18n.class_name(group_title) %>"></a>
      <%= active_element.component.page_section_title group_title %>
      <%= form.fields_for field do |subform| %>
        <% group.each do |label, name, checked| %>
          <%= subform.check_box(name, checked: checked, class: 'me-2') %>
          <%= subform.label name, label %>
          <br/>
        <% end %>
      <% end %>

    </div>
    <hr/>
  <% end %>
<% else %>
  <div class="container w-100">
    <%= form.fields_for field do |subform| %>
      <% options.fetch(:options).in_groups(options.fetch(:columns, 1)).reduce(&:zip).each do |columns| %>
        <div class="row w-100">
          <% columns.each do |label, name, checked| %>
            <div class="col">
              <% if [label, name, checked].any?(&:present?) %>
                <%= subform.check_box(name, checked: checked, class: 'me-2', tabindex: component.tabindex) %>
                <%= subform.label name, label %>
              <% end %>
            </div>
            <br/>
          <% end %>
        </div>
      <% end %>
    <% end %>
  </div>
<% end %>

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
active_element-0.0.31 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.30 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.29 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.28 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.27 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.26 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.24 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.23 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.22 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.21 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.19 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.18 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.17 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.16 app/views/active_element/components/form/_check_boxes.html.erb
active_element-0.0.15 app/views/active_element/components/form/_check_boxes.html.erb