Sha256: f19e8cebbfdd3391b468c4f1daaf57ac08f3c3ddbf57cb5907ee4e1e216f6a9a
Contents?: true
Size: 1.08 KB
Versions: 2
Compression:
Stored size: 1.08 KB
Contents
module FormtasticRebootstrap 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 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 end 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 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
formtastic_rebootstrap-0.0.2 | lib/formtastic_rebootstrap/inputs/check_boxes_input.rb |
formtastic_rebootstrap-0.0.1 | lib/formtastic_rebootstrap/inputs/check_boxes_input.rb |