Sha256: cb2e8d9538e4fbb1136824dfdb4d8f3ef62a76c3c138d2bc3beabde3de99daf1

Contents?: true

Size: 903 Bytes

Versions: 15

Compression:

Stored size: 903 Bytes

Contents

require "action_view/helpers/tags/collection_helpers"

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

        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

15 entries across 15 versions & 1 rubygems

Version Path
actionview-5.1.7 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.7.rc1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.6.2 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.6.1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.6 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.5 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.5.rc1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.4 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.4.rc1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.3 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.3.rc3 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.3.rc2 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.3.rc1 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.2 lib/action_view/helpers/tags/collection_check_boxes.rb
actionview-5.1.2.rc1 lib/action_view/helpers/tags/collection_check_boxes.rb