From f04ec6a227b702342d2fb841f94915499bf6101a Mon Sep 17 00:00:00 2001 From: Jan Maurits Faber Date: Sat, 6 Nov 2010 15:13:56 +0100 Subject: Added support for Erubis <%== tag <%== x %> is syntactic sugar for <%= raw(x) %> Signed-off-by: Michael Koziarski [#5918 status:committed] --- actionpack/lib/action_view/template/handlers/erb.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/template/handlers') diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb index b827610456..4c1f3d70ca 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionpack/lib/action_view/template/handlers/erb.rb @@ -40,7 +40,11 @@ module ActionView end def add_expr_escaped(src, code) - src << '@output_buffer.append= ' << escaped_expr(code) << ';' + if code =~ BLOCK_EXPR + src << "@output_buffer.safe_append= " << code + else + src << "@output_buffer.safe_concat((" << code << ").to_s);" + end end def add_postamble(src) -- cgit v1.2.3