Browse Source

新增:分页数量限制修改

pull/313/head
yystopf 3 years ago
parent
commit
5c5b4b5d92
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/application_controller.rb

+ 1
- 1
app/controllers/application_controller.rb View File

@@ -619,7 +619,7 @@ class ApplicationController < ActionController::Base

def kaminari_paginate(relation)
limit = params[:limit] || params[:per_page]
limit = (limit.to_i.zero? || limit.to_i > 20) ? 20 : limit.to_i
limit = (limit.to_i.zero? || limit.to_i > 25) ? 25 : limit.to_i
page = params[:page].to_i.zero? ? 1 : params[:page].to_i

relation.page(page).per(limit)


Loading…
Cancel
Save