Fix wrapper options support for boolean types

This commit is contained in:
Obfuscoder 2014-10-02 21:57:55 +02:00
parent 84378b307c
commit c39fc0aec0
2 changed files with 9 additions and 1 deletions

View File

@ -41,7 +41,7 @@ module SimpleForm
# which won't generate the hidden checkbox. This is the default functionality
# in Rails > 3.2.1, and is backported in SimpleForm AV helpers.
def build_check_box(unchecked_value, options)
@builder.check_box(attribute_name, input_html_options, checked_value, unchecked_value)
@builder.check_box(attribute_name, options, checked_value, unchecked_value)
end
# Build a checkbox without generating the hidden field. See

View File

@ -197,4 +197,12 @@ class BooleanInputTest < ActionView::TestCase
end
end
end
test 'input boolean works with wrapper config defining a class for the input' do
swap_wrapper :default, self.custom_wrapper_with_input_class do
with_input_for @user, :active, :boolean
assert_select 'input.boolean.inline-class'
end
end
end