Fix options_for_select form helper result in a corner case. #814

Merged
merged 1 commit into from Mar 27, 2012
Jump to file or symbol
Failed to load files and symbols.
+1 −1
Split
@@ -703,7 +703,7 @@ def options_from_collection(collection, fields)
# Returns the options tags for a select based on the given option items
#
def options_for_select(option_items, selected_value=nil)
- return '' if option_items.blank?
+ return [] if option_items.blank?
option_items.map do |caption, value|
value ||= caption
content_tag(:option, caption, :value => value, :selected => option_is_selected?(value, caption, selected_value))