diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 173dbdde30ea6570136e26721bb1257ad8fe5e49..698ef0023468a76da98dfa3fb1e8e134b6a62027 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Improve line number detection for template errors [Nicholas Seckar] + * Update/clean up documentation (rdoc) * Upgrade to Prototype 1.4.0_rc0 [Sam Stephenson] diff --git a/actionpack/lib/action_view/template_error.rb b/actionpack/lib/action_view/template_error.rb index 9f7fc416c90bca97e2872b54bb0f5dbd2dfe78e6..b81173dafe633bbf65b0e90487eef5aebc3b12b8 100644 --- a/actionpack/lib/action_view/template_error.rb +++ b/actionpack/lib/action_view/template_error.rb @@ -47,7 +47,7 @@ def sub_template_of(file_name) def line_number if file_name - regexp = /#{Regexp.escape file_name}:(\d+)\s*$/ + regexp = /#{Regexp.escape File.basename(file_name)}:(\d+)\s*$/ [@original_exception.message, @original_exception.clean_backtrace].flatten.each do |line| return $1.to_i if regexp =~ line end