Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Always treat the object passed to content_tag_for as an array.

  • Loading branch information...
commit 67681cb1031f41a610e94b9339f0a1b6f2a99a39 1 parent 57aaaa6
Tim Cooper coop authored carlosantoniodasilva committed
Showing with 3 additions and 7 deletions.
  1. +3 −7 actionpack/lib/action_view/helpers/record_tag_helper.rb
10 actionpack/lib/action_view/helpers/record_tag_helper.rb
View
@@ -81,13 +81,9 @@ def div_for(record, *args, &block)
# <li id="person_123" class="person bar">...
#
def content_tag_for(tag_name, single_or_multiple_records, prefix = nil, options = nil, &block)
- if single_or_multiple_records.respond_to?(:to_ary)
- single_or_multiple_records.to_ary.map do |single_record|
- capture { content_tag_for_single_record(tag_name, single_record, prefix, options, &block) }
- end.join("\n").html_safe
- else
- content_tag_for_single_record(tag_name, single_or_multiple_records, prefix, options, &block)
- end
+ Array.wrap(single_or_multiple_records).map do |single_record|
+ capture { content_tag_for_single_record(tag_name, single_record, prefix, options, &block) }
+ end.join("\n").html_safe
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.