From a1b2dbd7d4e95fdde64a6b0529f6233efcdc99fe Mon Sep 17 00:00:00 2001 From: Brian Rose Date: Tue, 20 Dec 2011 13:38:16 -0700 Subject: Check for response to `#last` instead of `#first`. --- actionpack/lib/action_view/helpers/form_options_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb') diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index a8690430e5..3ee0d8ebc5 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -584,7 +584,7 @@ module ActionView # [nil, []] # { nil => [] } # - if !choices.empty? && choices.first.respond_to?(:first) && Array === choices.first.last + if !choices.empty? && choices.first.respond_to?(:last) && Array === choices.first.last 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]) -- cgit v1.2.3