aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-04-01 12:44:56 +0200
committerMichael Koziarski <michael@koziarski.com>2009-05-15 15:30:17 +1200
commiteb021707f53be46140b55a48e5ef03ed0577a45c (patch)
tree4967e9120b883ba4872963391499b8ddd4583299 /actionpack/lib
parentb6bac73b282c7e500c43810f2a937fc0047e5979 (diff)
downloadrails-eb021707f53be46140b55a48e5ef03ed0577a45c.tar.gz
rails-eb021707f53be46140b55a48e5ef03ed0577a45c.tar.bz2
rails-eb021707f53be46140b55a48e5ef03ed0577a45c.zip
Allow strings to be sent as collection to select.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index 6b385ef77d..6adbab175f 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -230,6 +230,8 @@ module ActionView
#
# NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
def options_for_select(container, selected = nil)
+ return container if String === container
+
container = container.to_a if Hash === container
selected, disabled = extract_selected_and_disabled(selected)