add pagy, improve checks#index
This commit is contained in:
parent
c44c9ccaba
commit
6d3a269231
11 changed files with 274 additions and 10 deletions
|
|
@ -3,7 +3,7 @@ class ChecksController < ApplicationController
|
|||
|
||||
# GET /checks or /checks.json
|
||||
def index
|
||||
@checks = Check.all
|
||||
@pagy, @checks = pagy(Check.search(filter_params[:s]))
|
||||
end
|
||||
|
||||
# GET /checks/1 or /checks/1.json
|
||||
|
|
@ -66,6 +66,10 @@ class ChecksController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def filter_params
|
||||
@filter_params ||= params.permit(filter: %i[s level])[:filter] || {}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue