diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-27 08:20:30 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-27 08:20:30 -0800 |
commit | ac8c729342e6b020a57d0d6887c8a8d5b39f96e0 (patch) | |
tree | a2dbd7bcd3a4f3d879cc52da89b9d5b58ea0a4c5 /actionpack/lib/action_view/helpers | |
parent | 0be0a978ef920384685537120da82d7ad60add1e (diff) | |
parent | 0195d6138b7e441283cbbded31ff4e94bcf61901 (diff) | |
download | rails-ac8c729342e6b020a57d0d6887c8a8d5b39f96e0.tar.gz rails-ac8c729342e6b020a57d0d6887c8a8d5b39f96e0.tar.bz2 rails-ac8c729342e6b020a57d0d6887c8a8d5b39f96e0.zip |
Merge pull request #8340 from skojin/grouped_options_for_select_without_hash_sort
No sort Hash options in #grouped_options_for_select
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 46ebe60ec2..9310a90f0f 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -482,15 +482,15 @@ module ActionView # grouped_options_for_select(grouped_options) # # Possible output: + # <optgroup label="North America"> + # <option value="US">United States</option> + # <option value="Canada">Canada</option> + # </optgroup> # <optgroup label="Europe"> # <option value="Denmark">Denmark</option> # <option value="Germany">Germany</option> # <option value="France">France</option> # </optgroup> - # <optgroup label="North America"> - # <option value="US">United States</option> - # <option value="Canada">Canada</option> - # </optgroup> # # Sample usage (divider): # grouped_options = [ @@ -530,8 +530,6 @@ module ActionView body.safe_concat content_tag(:option, prompt_text(prompt), :value => "") end - grouped_options = grouped_options.sort if grouped_options.is_a?(Hash) - grouped_options.each do |container| if divider label = divider |