diff options
author | Ryan Bates <ryan@railscasts.com> | 2008-10-28 17:31:33 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-10-28 17:31:33 -0500 |
commit | 4ad5aa9a39a83863331a7665407dac475855765b (patch) | |
tree | f5002e97e755b3bac25988562ed79ebc72c92f68 /actionpack/lib | |
parent | 4684e76aefca2c49d3421e7184a1d568e2cc0dac (diff) | |
download | rails-4ad5aa9a39a83863331a7665407dac475855765b.tar.gz rails-4ad5aa9a39a83863331a7665407dac475855765b.tar.bz2 rails-4ad5aa9a39a83863331a7665407dac475855765b.zip |
Ensure @content_for_* is checked before yielding to block in render :layout [#8994 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/renderable.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb index 3d4dc6d522..c23b8cde89 100644 --- a/actionpack/lib/action_view/renderable.rb +++ b/actionpack/lib/action_view/renderable.rb @@ -36,7 +36,7 @@ module ActionView result = view.send(method_name(local_assigns), local_assigns) do |*names| ivar = :@_proc_for_layout - if view.instance_variable_defined?(ivar) and proc = view.instance_variable_get(ivar) + if !view.instance_variable_defined?(:"@content_for_#{names.first}") && view.instance_variable_defined?(ivar) && (proc = view.instance_variable_get(ivar)) view.capture(*names, &proc) elsif view.instance_variable_defined?(ivar = :"@content_for_#{names.first || :layout}") view.instance_variable_get(ivar) |