<commit_before>module FormtasticBootstrap
  module Inputs
    class CheckBoxesInput < Formtastic::Inputs::CheckBoxesInput
      include Base
      include Base::Choices

      # TODO Make sure help blocks work correctly.

      def to_html
        form_group_wrapping do
          label_html <<
          hidden_field_for_all << # Might need to remove this guy.
          collection.map { |choice|
            choice_html(choice)
          }.join("\n").html_safe
        end
      end

      def choice_html(choice)
        checkbox_wrapping do
          template.content_tag(:label,
            hidden_fields? ?
              check_box_with_hidden_input(choice) :
              check_box_without_hidden_input(choice) <<
            choice_label(choice),
            label_html_options.merge(choice_label_html_options(choice))
          )
        end<commit_msg>This fixes my issue with collection check_boxes not showing their error messages properly.<commit_after>module FormtasticBootstrap
  module Inputs
    class CheckBoxesInput < Formtastic::Inputs::CheckBoxesInput
      include Base
      include Base::Choices

      # TODO Make sure help blocks work correctly.

      def to_html
        bootstrap_wrapping do
          form_group_wrapping do
            hidden_field_for_all << # Might need to remove this guy.
              collection.map { |choice|
              choice_html(choice)
            }.join("\n").html_safe
          end
        end
      end

      def choice_html(choice)
        checkbox_wrapping do
          template.content_tag(:label,
            hidden_fields? ?
              check_box_with_hidden_input(choice) :
              check_box_without_hidden_input(choice) <<
            choice_label(choice),
            label_html_options.merge(choice_label_html_options(choice))
          )
        end
{'fraction_non_alphanumeric': 0.060556464811783964, 'fraction_numerical': 0.0, 'mean_word_length': 2.1137521222410864, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3013632', 'n_tokens_mistral': 489, 'n_tokens_neox': 481, 'n_words': 107}