From 540ebe37cd1a9551b739c552a0d4efd2adc7ff22 Mon Sep 17 00:00:00 2001 From: Semyon Perepelitsa Date: Thu, 24 Jan 2013 04:26:49 +0800 Subject: Fix `content_tag_for` with array html option. It would embed array as string instead of joining it like `content_tag` does: content_tag(:td, class: ["foo", "bar"]){} #=> '' Before: content_tag_for(:td, item, class: ["foo", "bar"]){} #=> '' After: content_tag_for(:td, item, class: ["foo", "bar"]){} #=> '' --- actionpack/lib/action_view/helpers/record_tag_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionpack/lib/action_view/helpers/record_tag_helper.rb index 271a194913..f767957fa9 100644 --- a/actionpack/lib/action_view/helpers/record_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb @@ -92,7 +92,7 @@ module ActionView # for each record. def content_tag_for_single_record(tag_name, record, prefix, options, &block) options = options ? options.dup : {} - options[:class] = "#{dom_class(record, prefix)} #{options[:class]}".rstrip + options[:class] = [ dom_class(record, prefix), options[:class] ].compact options[:id] = dom_id(record, prefix) if block_given? -- cgit v1.2.3