aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2013-07-21 17:02:28 -0700
committerPiotr Sarnacki <drogus@gmail.com>2013-07-21 17:02:28 -0700
commitc43db5564a48bc41ae55cead400af066337e63b6 (patch)
treeab1589659f1bd0f64332edfabbe64207c04c654e /actionview/lib
parent2c1ddd82e68d24e793a7e80076459455aa8fb5d6 (diff)
parentcadfe4bf452e5ae1f4e54a01709f6eba6eb17dc2 (diff)
downloadrails-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.rb6
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