Merge pull request #1143 from obfuscoder/master

Fix wrapper options support for boolean input types
This commit is contained in:
Rafael Mendonça França 2014-11-19 18:57:03 -02:00
commit ee62c0f37a
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