mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Fix wrapper options support for boolean types
This commit is contained in:
parent
84378b307c
commit
c39fc0aec0
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue