Permalink
Browse files

Improved line number reporting for template errors

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent c45ea78 commit 2cad95d851ae72dadc1479ea2a21cd056dc8f06e @seckar seckar committed Oct 13, 2005
Showing with 5 additions and 3 deletions.
  1. +2 −0 actionpack/CHANGELOG
  2. +3 −3 actionpack/lib/action_view/base.rb
View
@@ -1,5 +1,7 @@
*SVN*
+* Improved line number reporting for template errors [Nicholas Seckar]
+
* Added :locals support for render :inline #2463 [mdabney@cavoksolutions.com]
* Unset the X-Requested-With header when using the xhr wrapper in functional tests so that future requests aren't accidentally xhr'ed #2352 [me@julik.nl, Sam Stephenson]
@@ -404,10 +404,10 @@ def compile_template(extension, template, file_name, local_assigns)
line_offset += 2 if extension && (extension.to_sym == :rxml)
begin
- if file_name
- CompiledTemplates.module_eval(render_source, file_name, -line_offset)
+ unless file_name.blank?
+ CompiledTemplates.module_eval(render_source, File.expand_path(file_name), -line_offset)
else
- CompiledTemplates.module_eval(render_source)
+ CompiledTemplates.module_eval(render_source, 'compiled-template', -line_offset)
end
rescue Object => e
if logger

0 comments on commit 2cad95d

Please sign in to comment.