ruby - pagy 与 fast_page 共同使用
访问量: 11
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 end