Rails 3:在同一屏幕上使用 will_paginate 处理多于一组数据时遇到问题
有趣的错误或副作用或其他东西...
使用 will_paginate 处理同一屏幕上两组数据的分页(blog_article 和 favorites_list),
当用户单击 blog_articles 的“下一步”时,它也会对 favorites_lists 进行分页,这会消失如果收藏夹的页面少于博客。
问题(大概)是 url 包含“page=3”,并且没有描述正在分页的哪组数据。
关于让 url(和控制器代码)指定哪个数据集正在分页的“正确”方法有什么想法吗?
Interesting bug or side effect or something...
using will_paginate to handle the pagination of two sets of data on the same screen (blog_article and favorites_list)
what happens is when the user clicks "next" for blog_articles, it also paginates favorites_lists, which disappears if there are fewer pages of favorites than blogs.
The issue (presumably) is that the url contains "page=3" and there's no description of WHICH set of data is being paginated.
Any thoughts on the "right" way to have the url (and controller code) specify WHICH dataset is being paginated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了答案,
:param_name
参数will_paginate @users, :param_name =>; 'user_page'
位于
http://candidcode. com/2009/11/03/paginating-multiple-models-using-will_paginate-on-the-same-page/
found the answer, the
:param_name
parameterwill_paginate @users, :param_name => 'user_page'
at
http://candidcode.com/2009/11/03/paginating-multiple-models-using-will_paginate-on-the-same-page/