I am using will_paginate
gem in my ROR
project to show the records in pages.
I want the next page to be loaded without reloading the whole
To follow on from @Pierre's excellent answer re creating a helper, I've seen some follow up questions regarding updating the views (a problem I initially had). @Pierre follows up with that problem by stating that you need to create a js response. Here's what I did after creating the helper:
in my show.html.erb
<%= render @comments %>
<%= js_will_paginate @comments %>
I created another file called show.js.erb (so two formats for show)
// to update comments
$("#see-comments").html("<%= j render @comments %>");
// to update the pagination links
$("#pagination-comments").html('<%= js_will_paginate @comments %>');