diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2013-07-21 17:02:28 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2013-07-21 17:02:28 -0700 |
commit | c43db5564a48bc41ae55cead400af066337e63b6 (patch) | |
tree | ab1589659f1bd0f64332edfabbe64207c04c654e /actionview/lib | |
parent | 2c1ddd82e68d24e793a7e80076459455aa8fb5d6 (diff) | |
parent | cadfe4bf452e5ae1f4e54a01709f6eba6eb17dc2 (diff) | |
download | rails-c43db5564a48bc41ae55cead400af066337e63b6.tar.gz rails-c43db5564a48bc41ae55cead400af066337e63b6.tar.bz2 rails-c43db5564a48bc41ae55cead400af066337e63b6.zip |
Merge pull request #11517 from nashby/optgroup-html-attributes
add support for html attributes to grouped_options_for_select
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/form_options_helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb index 4e9ef94ff3..8351548f06 100644 --- a/actionview/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -520,12 +520,16 @@ module ActionView end grouped_options.each do |container| + html_attributes = option_html_attributes(container) + if divider label = divider else label, container = container end - body.safe_concat content_tag(:optgroup, options_for_select(container, selected_key), :label => label) + + html_attributes = { :label => label }.merge(html_attributes) + body.safe_concat content_tag(:optgroup, options_for_select(container, selected_key), html_attributes) end body |