Sha256: 2732c0a15701a7097c6fa8ae32d6e6c4fc6fd75aafa00915802ac05925374b84

Contents?: true

Size: 967 Bytes

Versions: 29

Compression:

Stored size: 967 Bytes

Contents

# frozen_string_literal: true

require "action_view/helpers/tags/collection_helpers"

module ActionView
  module Helpers
    module Tags # :nodoc:
      class CollectionCheckBoxes < Base # :nodoc:
        include CollectionHelpers
        include FormOptionsHelper

        class CheckBoxBuilder < Builder # :nodoc:
          def check_box(extra_html_options = {})
            html_options = extra_html_options.merge(@input_html_options)
            html_options[:multiple] = true
            html_options[:skip_default_ids] = false
            @template_object.check_box(@object_name, @method_name, html_options, @value, nil)
          end
        end

        def render(&block)
          render_collection_for(CheckBoxBuilder, &block)
        end

        private
          def render_component(builder)
            builder.check_box + builder.label
          end

          def hidden_field_name
            "#{super}[]"
          end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 5 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/actionview-7.1.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.2.1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.1.5.1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.2 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.1.5 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.1.2 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.1.4.2 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.1.1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.1.4.1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.1.4 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.0 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.0.rc1 lib/action_view/helpers/tags/collection_check_boxes.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionview-7.1.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.0.beta3 lib/action_view/helpers/tags/collection_check_boxes.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/actionview-7.1.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/actionview-7.1.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.0.beta2 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.1.3.4 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-7.2.0.beta1 lib/action_view/helpers/tags/collection_check_boxes.rb