From ebf9b3737b9470c2fbedf39ac5cd5a4cba81afc1 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Tue, 15 May 2007 06:36:34 +0000 Subject: Add some performance enhancements to ActionView. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6736 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/base.rb | 4 ++-- actionpack/lib/action_controller/layout.rb | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index c922dc7284..e3b52278ba 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1213,14 +1213,14 @@ module ActionController #:nodoc: end def template_exempt_from_layout?(template_name = default_template_name) - extension = @template.pick_template_extension(template_name) rescue nil + extension = @template && @template.pick_template_extension(template_name) name_with_extension = !template_name.include?('.') && extension ? "#{template_name}.#{extension}" : template_name extension == :rjs || @@exempt_from_layout.any? { |ext| name_with_extension =~ ext } end def assert_existence_of_template_file(template_name) unless template_exists?(template_name) || ignore_missing_templates - full_template_path = template_name.include?('.') ? template_name : @template.send(:full_template_path, template_name, "#{@template.send(:template_format)}.erb") + full_template_path = template_name.include?('.') ? template_name : @template.full_template_path(template_name, "#{@template.template_format}.erb") template_type = (template_name =~ /layouts/i) ? 'layout' : 'template' raise(MissingTemplate, "Missing #{template_type} #{full_template_path}") end diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 7de66cd66e..860d7b383c 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -214,7 +214,6 @@ module ActionController #:nodoc: # weblog/standard, but layout "standard" will return layouts/standard. def active_layout(passed_layout = nil) layout = passed_layout || self.class.default_layout - active_layout = case layout when String then layout when Symbol then send(layout) -- cgit v1.2.3