Allow searching in logs view
This commit is contained in:
parent
c467e0ef23
commit
10d5bab37c
2 changed files with 12 additions and 4 deletions
|
|
@ -2,6 +2,13 @@ class LogsController < ApplicationController
|
|||
before_action :authenticate_user!
|
||||
|
||||
def index
|
||||
@logs = Log.paginate(page: params[:page], per_page: 20)
|
||||
logs = Log
|
||||
|
||||
if params[:search].present?
|
||||
logger.debug "Searching for #{params[:search]}"
|
||||
logs = logs.where("message ilike ?", "%#{params[:search]}%")
|
||||
end
|
||||
|
||||
@logs = logs.paginate(page: params[:page], per_page: 20)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue