aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.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/base.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/base.rb')
-rw-r--r--actionpack/lib/action_controller/base.rb18
1 files changed, 2 insertions, 16 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 172bf7363f..670a049497 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -397,9 +397,6 @@ module ActionController #:nodoc:
# Returns the name of the action this controller is processing.
attr_accessor :action_name
- # Templates that are exempt from layouts
- @@exempt_from_layout = Set.new([/\.rjs$/])
-
class << self
# Factory for the standard create, process loop where the controller is discarded after processing.
def process(request, response) #:nodoc:
@@ -517,13 +514,7 @@ module ActionController #:nodoc:
protected :filter_parameters
end
- # Don't render layouts for templates with the given extensions.
- def exempt_from_layout(*extensions)
- regexps = extensions.collect do |extension|
- extension.is_a?(Regexp) ? extension : /\.#{Regexp.escape(extension.to_s)}$/
- end
- @@exempt_from_layout.merge regexps
- end
+ delegate :exempt_from_layout, :to => 'ActionView::Base'
end
public
@@ -1241,12 +1232,7 @@ module ActionController #:nodoc:
end
def template_exists?(template_name = default_template_name)
- @template.file_exists?(template_name)
- end
-
- def template_exempt_from_layout?(template_name = default_template_name)
- template_name = @template.pick_template(template_name).to_s if @template
- @@exempt_from_layout.any? { |ext| template_name =~ ext }
+ @template.send(:_pick_template, template_name) ? true : false
rescue ActionView::MissingTemplate
false
end