Thanks for this ryan, amazing as always!
I used this with Kaminari along with using a script to see if the pagination links are in the window view area (since I was working with a table that is in the middle of the page)
Coffee Script below:
I used @pages.current_page < @pages.num_pages since I couldn't get the @pages.next? method working with collections. Hopefully it will work in a future release.
+1
Did you find a solution to this?.. I am getting a similar error!
Well, you could add
:dependent => :destroyto eachhas_manyassociation. and then simply delete your Survey!I encountered this too!.. any solutions so far?
Sweet.. I was looking for this... Thanks!
Thanks.. I ran into this as well!
Thanks for this ryan, amazing as always!
I used this with Kaminari along with using a script to see if the pagination links are in the window view area (since I was working with a table that is in the middle of the page)
Coffee Script below:
jQuery -> isScrolledIntoView = (elem) -> docViewTop = $(window).scrollTop() docViewBottom = docViewTop + $(window).height() elemTop = $(elem).offset().top elemBottom = elemTop + $(elem).height() (elemTop >= docViewTop) && (elemTop <= docViewBottom) if $('.pagination').length $(window).scroll -> url = $('.pagination .next_page a').attr('href') if url && isScrolledIntoView('.pagination') $('.pagination').text('Fetching more...') $.getScript(url) $(window).scroll()And in the index.js.erb file:
I used
@pages.current_page < @pages.num_pagessince I couldn't get the@pages.next?method working with collections. Hopefully it will work in a future release.