From e761cd5f221939e55708d9fe2b3db284cd40afe3 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 30 Jan 2015 11:52:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BC=9A=E4=B8=A2=E5=A4=B1=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/system_log_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/system_log_helper.rb b/app/helpers/system_log_helper.rb index 12e02ca8f..5412339de 100644 --- a/app/helpers/system_log_helper.rb +++ b/app/helpers/system_log_helper.rb @@ -25,7 +25,10 @@ module SystemLogHelper logs = Kaminari.paginate_array(logs).page(page).per(per).collect! { |log| parse(log) } #将分页后的记录的搜索结果添加样式,样式中的\0是给给r占位置的。 logs.collect! do |log| - keywords.each { |r| log.gsub!(r, '\0') && log = "" if log =~ Regexp.new("SystemLogController",'i') } + if log =~ Regexp.new("SystemLogController",'i') + log = "" + end + keywords.each { |r| log.gsub!(r, '\0') } log end