class FormtasticRebootstrap::Inputs::CheckBoxesInput
Public Instance Methods
checkbox_wrapping(&block)
click to toggle source
# File lib/formtastic_rebootstrap/inputs/check_boxes_input.rb, line 30 def checkbox_wrapping(&block) class_name = "checkbox" class_name += " checkbox-inline" if options[:inline] template.content_tag(:div, template.capture(&block).html_safe, :class => class_name ) end
choice_html(choice)
click to toggle source
# File lib/formtastic_rebootstrap/inputs/check_boxes_input.rb, line 18 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 end
to_html()
click to toggle source
TODO Make sure help blocks work correctly.
# File lib/formtastic_rebootstrap/inputs/check_boxes_input.rb, line 9 def to_html bootstrap_wrapping do hidden_field_for_all << # Might need to remove this guy. collection.map { |choice| choice_html(choice) }.join("\n").html_safe end end