简体   繁体   中英

Scroll down pagination in rails using will_paginate

I wanna use infinite scroll down pagination in rails and want to pass the information like page number so that next data can be retrieved in the action and for the scroll down i can append the data to the existing data in my view.

is there any thing scroll down pagination that we can do with the will_paginate?

Thanks in advance --Vam.

这个Jquery插件可以帮助https://github.com/jney/jquery.pageless

to see how to do this yourself, have a look at

http://railscasts.com/episodes/174-pagination-with-ajax

to see how to use will_paginate with ajax (jquery). Ryan shows how to modify the usual will_paginate approach. First how to modify the links of the pagination bar and then he shows how to modify the view to display newly loaded objects... In this video he replaces shown items by newly loaded items. You'd just have to tweak the index.js.erb to append them.

nevertheless ... you might also want to checkout his video

http://railscasts.com/episodes/114-endless-page

in which he shows what you asked for but without will_pagination

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM