Permalink
Browse files

Merge pull request #46 from cluesque/checkbox_label

Only label a checkbox once
  • Loading branch information...
2 parents c40d7da + 402d5b1 commit fe0ec26109e46400612cc2d2db0ef998514ebd53 @sodabrew sodabrew committed Feb 2, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/formtastic-bootstrap/inputs/boolean_input.rb
@@ -6,7 +6,7 @@ class BooleanInput < Formtastic::Inputs::BooleanInput
def to_html
control_group_wrapping do
- control_label_html <<
+ options[:label_outside] ? control_label_html : "".html_safe <<
hidden_field_html <<
controls_wrapping do
label_with_nested_checkbox
@@ -17,7 +17,7 @@ def to_html
def label_with_nested_checkbox
builder.label(
method,
- label_text_with_embedded_checkbox,
+ options[:label_outside] ? check_box_html : label_text_with_embedded_checkbox,
label_html_options.tap do |options|
options[:class] << "checkbox"
end

0 comments on commit fe0ec26

Please sign in to comment.