开发者

rails 3: trouble using will_paginate for more than one set of data on same screen

开发者 https://www.devze.com 2023-03-19 11:04 出处:网络
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)

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 "ne开发者_StackOverflowxt" 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?


found the answer, the :param_name parameter

will_paginate @users, :param_name => 'user_page'

at http://candidcode.com/2009/11/03/paginating-multiple-models-using-will_paginate-on-the-same-page/

0

精彩评论

暂无评论...
验证码 换一张
取 消