From a9ad763c86e110c280be0b7a763496f9e1204de0 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Wed, 17 Jun 2009 18:08:45 -0700 Subject: Drive the final stake through @content_for_*'s heart! --- actionpack/lib/action_view/helpers/capture_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_view/helpers/capture_helper.rb') diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb index b4197479a0..1c29eb3b81 100644 --- a/actionpack/lib/action_view/helpers/capture_helper.rb +++ b/actionpack/lib/action_view/helpers/capture_helper.rb @@ -116,10 +116,9 @@ module ActionView # named @content_for_#{name_of_the_content_block}. The preferred usage is now # <%= yield :footer %>. def content_for(name, content = nil, &block) - ivar = "@content_for_#{name}" content = capture(&block) if block_given? - instance_variable_set(ivar, "#{instance_variable_get(ivar)}#{content}") - nil + return @_content_for[name] << content if content + @_content_for[name] end # Use an alternate output buffer for the duration of the block. -- cgit v1.2.3