From d229d273d08dedb583b22d258da465231e062a23 Mon Sep 17 00:00:00 2001 From: vfilby Date: Tue, 25 Jan 2011 15:05:25 -0500 Subject: [PATCH] In Rails3 all strings are assumed to be bad and are escaped. encapsulating the render_audits command was not enough because the changes were escape separately in the render_audits call. To make the audits render properly the changes have to be unescaped --- lib/simple_audit/helper.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/simple_audit/helper.rb b/lib/simple_audit/helper.rb index 5e53390..f68836e 100644 --- a/lib/simple_audit/helper.rb +++ b/lib/simple_audit/helper.rb @@ -19,13 +19,14 @@ def render_audits(audited_model) "\n" + audited_model.class.human_attribute_name(k) + ":" + - content_tag(:span, v.last, :class => 'current') + - content_tag(:span, v.first, :class => 'previous') + content_tag(:span, v.last, :class => 'current')+ + content_tag(:span, v.first, :class => 'previous') + end else audit.change_log.reject{|k, v| v.blank?}.collect {|k, v| "\n#{audited_model.class.human_attribute_name(k)}: #{v}"} end - changes.join + raw( changes.join ) end end end