aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/base.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 906e44ec9b..1f33d22e56 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -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]
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index c9557fe96e..c4fb589063 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -404,10 +404,10 @@ module ActionView #:nodoc:
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