English 中文(简体)
将自动查找我是否在最后一页上
原标题:will_paginate find out if I m on the last page

I m trying to use will paginate with ajax, but I don t show the will_paginate buttons... instead I use a see more button, that makes an Ajax request and append the results to the page. what I m trying to do is disable this see more button if I hit the last page of records!! Any idea how to know that the current page is the last page??

最佳回答
@collection.total_pages == @collection.current_page
问题回答

访问 方法将会为您提供当前要返回的页面总数。 您可以使用此方法使用 方法对活动页面进行评估。 如果您在每次扩展时重新装入您的收藏, 仍然适用此方法 。

如果本次评价属实, 将使用 AJAX 调用来替换 HTML 内容 。

您可以使用 next_ page 条件

@collection.next_page.present?




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签