aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/rendering.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-01 11:53:09 +0200
committerJosé Valim <jose.valim@gmail.com>2011-05-01 13:40:12 +0200
commit2f683fd870d0e4c5aff38510ef03c7e5144a1ea4 (patch)
treeeba0e7816c0460907bf3df6202c6056e84ccd430 /actionpack/lib/action_view/rendering.rb
parentbebaccdf4a3a17f2ead349cca891032e245655ff (diff)
downloadrails-2f683fd870d0e4c5aff38510ef03c7e5144a1ea4.tar.gz
rails-2f683fd870d0e4c5aff38510ef03c7e5144a1ea4.tar.bz2
rails-2f683fd870d0e4c5aff38510ef03c7e5144a1ea4.zip
Remove more dependencies from the view.
Diffstat (limited to 'actionpack/lib/action_view/rendering.rb')
-rw-r--r--actionpack/lib/action_view/rendering.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/actionpack/lib/action_view/rendering.rb b/actionpack/lib/action_view/rendering.rb
index 017a27976c..9850965456 100644
--- a/actionpack/lib/action_view/rendering.rb
+++ b/actionpack/lib/action_view/rendering.rb
@@ -4,7 +4,7 @@ module ActionView
# = Action View Rendering
module Rendering
# This is temporary until we remove the renderer dependency from AV.
- delegate :render, :render_body, :to => :@_renderer
+ delegate :render, :render_body, :to => :@view_renderer
# Returns the contents that are yielded to a layout, given a name or a block.
#
@@ -52,20 +52,15 @@ module ActionView
# Hello David
# </html>
#
- def _layout_for(*args)
- name = args.first
- name = :layout unless name.is_a?(Symbol)
- @_view_flow.get(name).html_safe
- end
-
- # Handle layout for calls from partials that supports blocks.
- def _block_layout_for(*args, &block)
+ def _layout_for(*args, &block)
name = args.first
- if !name.is_a?(Symbol) && block
+ if name.is_a?(Symbol)
+ @_view_flow.get(name).html_safe
+ elsif block
capture(*args, &block)
else
- _layout_for(*args)
+ @_view_flow.get(:layout).html_safe
end
end
end