Skip to content
Browse files

Merge pull request #46 from cluesque/checkbox_label

Only label a checkbox once
  • Loading branch information...
2 parents 9b483c8 + 22af072 commit d02ec343f63ae975d9cd66cf0e8c7b974885ede5 @sodabrew sodabrew committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/formtastic-bootstrap/inputs/boolean_input.rb
View
4 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 d02ec34

Please sign in to comment.
Something went wrong with that request. Please try again.