Make it possible to override required value that was set in the wrapper.

This commit is contained in:
Vasiliy Ermolovich 2015-05-03 20:02:56 +03:00
parent 709f3e58c6
commit a280ba770f
2 changed files with 5 additions and 4 deletions

View File

@ -7,10 +7,10 @@ module SimpleForm
def html5(wrapper_options = nil)
@html5 = true
if has_required?
input_html_options[:required] = true
input_html_options[:'aria-required'] = true
end
input_html_options[:required] = has_required?
input_html_options[:'aria-required'] = has_required? || nil
nil
end

View File

@ -118,6 +118,7 @@ class RequiredTest < ActionView::TestCase
concat f.input :name, required: false
end
assert_no_select 'input[type=text][required]'
assert_no_select 'input[type=text][aria-required]'
end
end
end