aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-03 14:01:45 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-03 14:01:45 -0500
commit1a478923dc909bf7b6aea4f2ad49cbeee6dea259 (patch)
tree44cf634937e470352b6eafde6d0169ab0b5fbf96 /actionpack/lib/action_controller/base.rb
parent8a442e0d57fabedcaf3ded836cfc12f7067ead68 (diff)
downloadrails-1a478923dc909bf7b6aea4f2ad49cbeee6dea259.tar.gz
rails-1a478923dc909bf7b6aea4f2ad49cbeee6dea259.tar.bz2
rails-1a478923dc909bf7b6aea4f2ad49cbeee6dea259.zip
Reduce the number of callsites for new TemplateFiles
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 009c9eec99..a4bade1bd5 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -1235,8 +1235,9 @@ module ActionController #:nodoc:
end
def template_exempt_from_layout?(template_name = default_template_name)
- template_name = @template.send(:template_file_from_name, template_name) if @template
- @@exempt_from_layout.any? { |ext| template_name.to_s =~ ext }
+ extension = @template && @template.pick_template_extension(template_name)
+ name_with_extension = !template_name.include?('.') && extension ? "#{template_name}.#{extension}" : template_name
+ @@exempt_from_layout.any? { |ext| name_with_extension =~ ext }
end
def default_template_name(action_name = self.action_name)