Sha256: 4b13789d167690f198eec33ee5a67d049258d0b3d117d4b504b57c2c846b895f

Contents?: true

Size: 881 Bytes

Versions: 10

Compression:

Stored size: 881 Bytes

Contents

module BulmaFormBuilder
  module Inputs
    module CollectionCheckBoxes
      extend ActiveSupport::Concern
      include Base

      included do
        def collection_check_boxes_with_bulma(method, collection, value_method, text_method, options = {}, html_options = {}) # rubocop:disable Metrics/ParameterLists
          html = form_field_builder(method, options, html_options) do
            collection_check_boxes_without_bulma(method, collection, value_method, text_method, options, html_options) do |b|
              content_tag(:label, class: 'checkbox') do
                concat b.check_box
                concat content_tag(:span, class: 'control-label') { b.text }
              end
            end
          end
          hidden_field(method, value: '', multiple: true).concat(html)
        end

        bulma_alias :collection_check_boxes
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bulma_form_builder-0.4.3 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.4.2 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.4.1 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.4.0 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.3.1 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.3.0 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.2.1 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.2.0 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.1.1 lib/bulma_form_builder/inputs/collection_check_boxes.rb
bulma_form_builder-0.1.0 lib/bulma_form_builder/inputs/collection_check_boxes.rb