will_paginate find out if I'm on the last page

柔情痞子 提交于 2019-12-03 11:51:36
Alexandr Yakubenko
@collection.total_pages == @collection.current_page

Accessing the @collection.total_pages method will give you the total number of pages currently being returned. You can use this to evaluate against your active page using the @collection.current_page method. This is still applicable if you're reloading your collection on each expansion.

The implementation will be to use the AJAX call to replace the HTML content if this evaluation is true.

Marcelo Austria

You can use next_page condition

@collection.next_page.present?
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!