aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-22 15:16:28 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-22 15:25:13 -0700
commit72a574b5073b1debd58c954b34c54d3bdee7749f (patch)
tree994345ceb428e29ba7588ee5abc5cf2fa73de448 /actionpack/lib/action_controller/new_base
parent01129534cde293e3561dd7cc3cb5ae9ac3de9e8c (diff)
downloadrails-72a574b5073b1debd58c954b34c54d3bdee7749f.tar.gz
rails-72a574b5073b1debd58c954b34c54d3bdee7749f.tar.bz2
rails-72a574b5073b1debd58c954b34c54d3bdee7749f.zip
Get controller/layout_test.rb running on new base except for ActionController::Base.exempt_from_layout which is going to be deprecated.
Diffstat (limited to 'actionpack/lib/action_controller/new_base')
-rw-r--r--actionpack/lib/action_controller/new_base/layouts.rb21
1 files changed, 9 insertions, 12 deletions
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb
index bf5b14c4e1..35068db770 100644
--- a/actionpack/lib/action_controller/new_base/layouts.rb
+++ b/actionpack/lib/action_controller/new_base/layouts.rb
@@ -11,23 +11,20 @@ module ActionController
end
end
- def render_to_body(options)
- # render :text => ..., :layout => ...
- # or
- # render :anything_else
+ private
+
+ def _determine_template(options)
+ super
if (!options.key?(:text) && !options.key?(:inline) && !options.key?(:partial)) || options.key?(:layout)
- options[:_layout] = options.key?(:layout) ? _layout_for_option(options[:layout]) : _default_layout
+ options[:_layout] = _layout_for_option(options.key?(:layout) ? options[:layout] : :none, options[:_template].details)
end
-
- super
end
-
- private
- def _layout_for_option(name)
+ def _layout_for_option(name, details)
case name
- when String then _layout_for_name(name)
- when true then _default_layout(true)
+ when String then _layout_for_name(name, details)
+ when true then _default_layout(true, details)
+ when :none then _default_layout(false, details)
when false, nil then nil
else
raise ArgumentError,