aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/layout.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/layout.rb')
-rw-r--r--actionpack/lib/action_controller/layout.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb
index 815a55739f..caf29ea113 100644
--- a/actionpack/lib/action_controller/layout.rb
+++ b/actionpack/lib/action_controller/layout.rb
@@ -229,11 +229,13 @@ module ActionController #:nodoc:
private
def apply_layout?(template_with_options, options)
- if template_with_options
- (options.has_key?(:layout) && options[:layout]!=false) || options.values_at(:text, :file, :inline, :partial, :nothing).compact.empty?
- else
- true
- end
+ template_with_options ? candidate_for_layout?(options) : !template_exempt_from_layout?
+ end
+
+ def candidate_for_layout?(options)
+ (options.has_key?(:layout) && options[:layout] != false) ||
+ options.values_at(:text, :file, :inline, :partial, :nothing).compact.empty? &&
+ !template_exempt_from_layout?(default_template_name(options[:action]))
end
def pick_layout(template_with_options, options, deprecated_layout)