will_paginate find out if I'm on the last page

zeacuss picture zeacuss · May 22, 2012 · Viewed 7.8k times · Source

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??

Answer

Alexandr Yakubenko picture Alexandr Yakubenko · May 22, 2012
@collection.total_pages == @collection.current_page