Browse Source

更改:分页大小最高限制为50

pull/313/head
yystopf 3 years ago
parent
commit
e1c600a2f5
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

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

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

relation.page(page).per(limit)


Loading…
Cancel
Save