aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderable.rb
diff options
context:
space:
mode:
authorRyan Bates <ryan@railscasts.com>2008-08-17 19:29:24 -0500
committerJoshua Peek <josh@joshpeek.com>2008-08-17 19:29:24 -0500
commit38c7d73e73d569211c4dfadf96fc295a925b7c9c (patch)
tree9400fbbd277dafdde822fb9d3968f30764dbe9da /actionpack/lib/action_view/renderable.rb
parentdbb0abfb7e9eb9a63b721a38625e3eff66ced49d (diff)
downloadrails-38c7d73e73d569211c4dfadf96fc295a925b7c9c.tar.gz
rails-38c7d73e73d569211c4dfadf96fc295a925b7c9c.tar.bz2
rails-38c7d73e73d569211c4dfadf96fc295a925b7c9c.zip
pass yielded arguments to block for ActionView::Base#render with :layout [#847 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_view/renderable.rb')
-rw-r--r--actionpack/lib/action_view/renderable.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb
index 89ac500717..a28689dc69 100644
--- a/actionpack/lib/action_view/renderable.rb
+++ b/actionpack/lib/action_view/renderable.rb
@@ -31,7 +31,14 @@ module ActionView
view.send(:evaluate_assigns)
view.send(:set_controller_content_type, mime_type) if respond_to?(:mime_type)
- view.send(:execute, method_name(local_assigns), local_assigns)
+
+ view.send(method_name(local_assigns), local_assigns) do |*names|
+ if proc = view.instance_variable_get("@_proc_for_layout")
+ view.capture(*names, &proc)
+ else
+ view.instance_variable_get("@content_for_#{names.first || 'layout'}")
+ end
+ end
end
def method_name(local_assigns)