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/CHANGELOG | 2 ++ actionpack/lib/action_view/template_error.rb | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index ec19b42a5e..8e5492dd0f 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix TemplateError so it doesn't bomb on exceptions while running tests [rick] + * Fixed that named routes living under resources shouldn't have double slashes #10198 [isaacfeliu] * Make sure that cookie sessions use a secret that is at least 30 chars in length. [Koz] 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