发布时间: 2023-04-25 06:37:00
refer to:
https://github.com/planetscale/fast_page
在controller中: class controller.... def show pagy, collections = pagy( Student.all ) render json: { ... } end # 原封不动的复制下面这个方法,不要做任何修改 private def pagy_get_items(collection, pagy) collection.offset(pagy.offset).limit(pagy.items).fast_page end endBack