aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/capture_helper.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-17 18:08:45 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-17 18:08:45 -0700
commita9ad763c86e110c280be0b7a763496f9e1204de0 (patch)
treef3f6fe2d86a4536cae6f1a9a7ddf73d67c59f2e0 /actionpack/lib/action_view/helpers/capture_helper.rb
parent65102c8f1a55c8d73e44b62eed5e689017ace7cd (diff)
downloadrails-a9ad763c86e110c280be0b7a763496f9e1204de0.tar.gz
rails-a9ad763c86e110c280be0b7a763496f9e1204de0.tar.bz2
rails-a9ad763c86e110c280be0b7a763496f9e1204de0.zip
Drive the final stake through @content_for_*'s heart!
Diffstat (limited to 'actionpack/lib/action_view/helpers/capture_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/capture_helper.rb5
1 files changed, 2 insertions, 3 deletions
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 <tt>@content_for_#{name_of_the_content_block}</tt>. The preferred usage is now
# <tt><%= yield :footer %></tt>.
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.