关键字查询会丢失样式
This commit is contained in:
parent
852bb940a2
commit
e761cd5f22
|
@ -25,7 +25,10 @@ module SystemLogHelper
|
||||||
logs = Kaminari.paginate_array(logs).page(page).per(per).collect! { |log| parse(log) }
|
logs = Kaminari.paginate_array(logs).page(page).per(per).collect! { |log| parse(log) }
|
||||||
#将分页后的记录的搜索结果添加样式,样式中的\0是给给r占位置的。
|
#将分页后的记录的搜索结果添加样式,样式中的\0是给给r占位置的。
|
||||||
logs.collect! do |log|
|
logs.collect! do |log|
|
||||||
keywords.each { |r| log.gsub!(r, '<span class="search_results">\0</span>') && log = "" if log =~ Regexp.new("SystemLogController",'i') }
|
if log =~ Regexp.new("SystemLogController",'i')
|
||||||
|
log = ""
|
||||||
|
end
|
||||||
|
keywords.each { |r| log.gsub!(r, '<span class="search_results">\0</span>') }
|
||||||
log
|
log
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue