From e4c047e4891c446024e35548e872704d132ad2f7 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 1 Jun 2005 13:39:58 +0000 Subject: render(:action) and render() are the only two render calls to use a layout by default. All others default to :layout => false. Also, allow :layout => true to be a synonym for :layout => nil. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1378 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/layout.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_controller/layout.rb') diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 52b02f851d..237e274173 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -220,12 +220,10 @@ module ActionController #:nodoc: private def render_with_a_layout_options(options) return options unless options.is_a?(Hash) - case - when options[:text], options[:partial], options[:nothing], options[:inline] - # by default, :text, :partial, :inline, and :nothing never use a layout - { :layout => false }.merge(options) - else + if options.values_at(:text, :file, :template, :inline, :partial, :nothing).compact.empty? options + else + { :layout => false }.merge(options) end end @@ -236,7 +234,7 @@ module ActionController #:nodoc: case options[:layout] when FalseClass nil - when NilClass + when NilClass, TrueClass active_layout if action_has_layout? else active_layout(options[:layout]) -- cgit v1.2.3