aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/layout.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-08-31 11:34:46 -0500
committerJoshua Peek <josh@joshpeek.com>2008-08-31 11:34:46 -0500
commit086c3520c47c6c001b3ddbba8881b4175c433ed1 (patch)
tree23ca936ee79d23046caa0dcc5109c1e6ffcb6658 /actionpack/lib/action_controller/layout.rb
parent8eec694598978ec054d8fc8daf2ee704baf794fe (diff)
downloadrails-086c3520c47c6c001b3ddbba8881b4175c433ed1.tar.gz
rails-086c3520c47c6c001b3ddbba8881b4175c433ed1.tar.bz2
rails-086c3520c47c6c001b3ddbba8881b4175c433ed1.zip
Moved layout exemption logic into the view
Diffstat (limited to 'actionpack/lib/action_controller/layout.rb')
-rw-r--r--actionpack/lib/action_controller/layout.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb
index ef59c7d63e..66e9997ae0 100644
--- a/actionpack/lib/action_controller/layout.rb
+++ b/actionpack/lib/action_controller/layout.rb
@@ -238,7 +238,7 @@ module ActionController #:nodoc:
private
def candidate_for_layout?(options)
options.values_at(:text, :xml, :json, :file, :inline, :partial, :nothing, :update).compact.empty? &&
- !template_exempt_from_layout?(options[:template] || default_template_name(options[:action]))
+ !@template.send(:_exempt_from_layout?, options[:template] || default_template_name(options[:action]))
end
def pick_layout(options)
@@ -247,7 +247,7 @@ module ActionController #:nodoc:
when FalseClass
nil
when NilClass, TrueClass
- active_layout if action_has_layout? && !template_exempt_from_layout?(default_template_name)
+ active_layout if action_has_layout? && !@template.send(:_exempt_from_layout?, default_template_name)
else
active_layout(layout)
end
@@ -272,7 +272,9 @@ module ActionController #:nodoc:
end
def layout_directory?(layout_name)
- @template.file_exists?("#{File.join('layouts', layout_name)}.#{@template.template_format}")
+ @template.send(:_pick_template, "#{File.join('layouts', layout_name)}.#{@template.template_format}") ? true : false
+ rescue ActionView::MissingTemplate
+ false
end
end
end