aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-10-07 16:56:18 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-10-07 16:56:18 -0700
commit7f64e472772293a3a5bbf4a435d937dabd98ed92 (patch)
treef7791372136a52d4ddd13cf696040fad074e2c3d /actionpack/lib
parentd2db917841cacbdd6320460fd6fa3d07cd972139 (diff)
downloadrails-7f64e472772293a3a5bbf4a435d937dabd98ed92.tar.gz
rails-7f64e472772293a3a5bbf4a435d937dabd98ed92.tar.bz2
rails-7f64e472772293a3a5bbf4a435d937dabd98ed92.zip
just check to see that the first item in the list is an array
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index c677257d60..d636702111 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -579,7 +579,7 @@ module ActionView
def to_select_tag(choices, options, html_options)
selected_value = options.has_key?(:selected) ? options[:selected] : value(object)
- if !choices.empty? && choices.try(:first).try(:second).respond_to?(:each)
+ if !choices.empty? && Array === choices.first
option_tags = grouped_options_for_select(choices, :selected => selected_value, :disabled => options[:disabled])
else
option_tags = options_for_select(choices, :selected => selected_value, :disabled => options[:disabled])