aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim & Carlos Antonio da Silva <carlos+jose@plataformatec.com.br>2010-08-11 10:23:07 -0300
committerJosé Valim <jose.valim@gmail.com>2010-08-11 10:23:07 -0300
commitf08b58dd0c0ad860bb119bde94a46c6330ca1556 (patch)
tree00568b167c44ca324514b0ddb67ef0ab1514b045 /actionpack/lib
parentf5c5cdd4ae87b43c110fb341e6c7c27116dca606 (diff)
downloadrails-f08b58dd0c0ad860bb119bde94a46c6330ca1556.tar.gz
rails-f08b58dd0c0ad860bb119bde94a46c6330ca1556.tar.bz2
rails-f08b58dd0c0ad860bb119bde94a46c6330ca1556.zip
layout_for works again with objects as specified in the documentation and Rails 2.3 [#5357 state:resolved]
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/render/layouts.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/render/layouts.rb b/actionpack/lib/action_view/render/layouts.rb
index a474783a20..8882acca31 100644
--- a/actionpack/lib/action_view/render/layouts.rb
+++ b/actionpack/lib/action_view/render/layouts.rb
@@ -47,11 +47,15 @@ module ActionView
# Hello David
# </html>
#
- def _layout_for(name = nil, &block) #:nodoc:
- if !block || name
- @_content_for[name || :layout].html_safe
+ def _layout_for(*args, &block) #:nodoc:
+ name = args.first
+
+ if name.is_a?(Symbol)
+ @_content_for[name].html_safe
+ elsif block
+ capture(*args, &block)
else
- capture(&block)
+ @_content_for[:layout].html_safe
end
end