diff --git a/lib/simple_form/inputs/boolean_input.rb b/lib/simple_form/inputs/boolean_input.rb index 92b8e037..c137dfff 100644 --- a/lib/simple_form/inputs/boolean_input.rb +++ b/lib/simple_form/inputs/boolean_input.rb @@ -3,7 +3,6 @@ module SimpleForm class BooleanInput < Base def input if nested_boolean_style? - inline_label = options[:inline_label] == true ? label_text : options[:inline_label] build_hidden_field_for_checkbox + template.label_tag(nil, :class => "checkbox") { build_check_box_without_hidden_field + inline_label @@ -54,6 +53,11 @@ module SimpleForm :disabled => input_html_options[:disabled]) end + def inline_label + inline_label = options[:inline_label] + inline_label == true ? label_text : inline_label + end + # Booleans are not required by default because in most of the cases # it makes no sense marking them as required. The only exception is # Terms of Use usually presented at most sites sign up screen.