# File lib/simple_form/action_view_extensions/builder.rb, line 164
      def collection_check_boxes(attribute, collection, value_method, text_method, options={}, html_options={})
        rendered_collection = render_collection(
          collection, value_method, text_method, options, html_options
        ) do |item, value, text, default_html_options|
          default_html_options[:multiple] = true
          builder = instantiate_builder(CheckBoxBuilder, attribute, item, value, text, default_html_options)

          if block_given?
            yield builder
          else
            builder.check_box + builder.label(:class => "collection_check_boxes")
          end
        end

        # Append a hidden field to make sure something will be sent back to the
        # server if all checkboxes are unchecked.
        hidden = template.hidden_field_tag("#{object_name}[#{attribute}][]", "", :id => nil)

        wrap_rendered_collection(rendered_collection + hidden, options)
      end