Rails 4分页与动态数据 [英] Rails 4 pagination with dynamic data

查看:124
本文介绍了Rails 4分页与动态数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个rails4应用程序,使用will_paginate gem进行分页。

Hi I have a rails4 app using pagination with the will_paginate gem.

有没有办法处理非常频繁的对象的分页?如果你调用第一页,然后在页面2之后,考虑到新的对象是在同一时间创建的,那么它将会混乱数据(例如,sql请求中的偏移量将调用与第一页几乎相同的数据) )

Is there a way to handle pagination with objects created very often? If you call the first page and right after that the page 2, considering new objects are created in the meantime, it is going to mess data (the offset in the sql request is for example going to call almost the same data as the first page).

有没有办法使用快速变化的动态数据分页?

Is there a way to use pagination with rapidly changing dynamic data?

Thx为您的建议

推荐答案

此外,您可以使用光标宝石

这篇关于Rails 4分页与动态数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆