Move aria-required option to html5 component.

[Finishes #780]
This commit is contained in:
Cameron Cundiff 2013-04-11 08:20:32 -04:00
parent c142a73e22
commit 88e8ca2f77
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -66,7 +66,6 @@ module SimpleForm
@input_html_classes = @html_classes.dup
@input_html_options = html_options_for(:input, input_html_classes).tap do |o|
o['aria-required'] = true if has_required?
o[:readonly] = true if has_readonly?
o[:disabled] = true if has_disabled?
o[:autofocus] = true if has_autofocus?