From 8afb4e136b2482e1e3826d3e00981b4b89680e1a Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Mon, 26 Nov 2007 03:35:04 +0000 Subject: Fix TemplateError so it doesn't bomb on exceptions while running tests [rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/template_error.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_view/template_error.rb') diff --git a/actionpack/lib/action_view/template_error.rb b/actionpack/lib/action_view/template_error.rb index f82cb31846..01b4b15550 100644 --- a/actionpack/lib/action_view/template_error.rb +++ b/actionpack/lib/action_view/template_error.rb @@ -81,9 +81,9 @@ module ActionView private def strip_base_path(path) - File.expand_path(path). - gsub(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, ''). - gsub(@base_path, "") + stripped_path = File.expand_path(path).gsub(@base_path, "") + stripped_path.gsub!(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '') if defined?(RAILS_ROOT) + stripped_path end def source_location -- cgit v1.2.3