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