aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template
diff options
context:
space:
mode:
authorlest <just.lest@gmail.com>2011-11-30 21:51:01 +0300
committerlest <just.lest@gmail.com>2011-11-30 21:51:01 +0300
commit13cab6ef50ab665e634f2834acbb0212300a3797 (patch)
tree67042ef7dde42aa3aa8e3f58311f819e02803c75 /actionpack/lib/action_view/template
parent5b3d4f07857e2f86ea8df702ba7c42e144b54970 (diff)
downloadrails-13cab6ef50ab665e634f2834acbb0212300a3797.tar.gz
rails-13cab6ef50ab665e634f2834acbb0212300a3797.tar.bz2
rails-13cab6ef50ab665e634f2834acbb0212300a3797.zip
fix exception page when template contains utf-8 and parameters contain utf-8
Diffstat (limited to 'actionpack/lib/action_view/template')
-rw-r--r--actionpack/lib/action_view/template/error.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb
index 587e37a84f..fe27e54037 100644
--- a/actionpack/lib/action_view/template/error.rb
+++ b/actionpack/lib/action_view/template/error.rb
@@ -89,10 +89,14 @@ module ActionView
line_counter = start_on_line
return unless source_code = source_code[start_on_line..end_on_line]
- source_code.sum do |line|
+ extract = source_code.sum do |line|
line_counter += 1
"#{indent}#{line_counter}: #{line}\n"
end
+
+ extract.encode! if extract.respond_to?(:encode!)
+
+ extract
end
def sub_template_of(template_path)