aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/template')
-rw-r--r--actionpack/lib/action_view/template/error.rb5
-rw-r--r--actionpack/lib/action_view/template/handlers/erb.rb2
2 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb
index a947d746e3..6866eabf77 100644
--- a/actionpack/lib/action_view/template/error.rb
+++ b/actionpack/lib/action_view/template/error.rb
@@ -84,9 +84,8 @@ module ActionView
end
end
- def to_s
- "\n#{self.class} (#{message}) #{source_location}:\n\n" +
- "#{source_extract(4)}\n #{backtrace.join("\n ")}\n\n"
+ def annoted_source_code
+ source_extract(4)
end
private
diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb
index 705c2bf82e..237746437a 100644
--- a/actionpack/lib/action_view/template/handlers/erb.rb
+++ b/actionpack/lib/action_view/template/handlers/erb.rb
@@ -28,7 +28,7 @@ module ActionView
src << "@output_buffer.safe_concat('" << escape_text(text) << "');"
end
- BLOCK_EXPR = /(do|\{)(\s*\|[^|]*\|)?\s*\Z/
+ BLOCK_EXPR = /\s+(do|\{)(\s*\|[^|]*\|)?\s*\Z/
def add_expr_literal(src, code)
if code =~ BLOCK_EXPR