diff --git a/app/controllers/admin/inquiries_controller.rb b/app/controllers/admin/inquiries_controller.rb index 4049117819f..db7916b67f6 100644 --- a/app/controllers/admin/inquiries_controller.rb +++ b/app/controllers/admin/inquiries_controller.rb @@ -1,8 +1,11 @@ # frozen_string_literal: true class Admin::InquiriesController < AdminController + PAGER_NUMBER = 20 + def index - @inquiries = Inquiry.order(created_at: :desc) + per = params[:per] || PAGER_NUMBER + @inquiries = Inquiry.order(created_at: :desc).page(params[:page]).per(per) end def show diff --git a/app/views/admin/inquiries/index.html.slim b/app/views/admin/inquiries/index.html.slim index fd19de45a80..d561ae92330 100644 --- a/app/views/admin/inquiries/index.html.slim +++ b/app/views/admin/inquiries/index.html.slim @@ -19,6 +19,8 @@ hr.a-border .page-body__inner .container.is-md - if @inquiries.present? + = paginate @inquiries .card-list.a-card .card-list__items = render partial: 'inquiries_item', collection: @inquiries, as: :inquiry + = paginate @inquiries