I've asked this question before, but I think I've figured what the problem may be.
I have a page, which holds a table div. I use an AJAX call to get a table (not a partial, its just another table.html.erb with its own method in its controller).
In this table.html.erb, I followed Kaminari guidelines for AJAX pagination. Why use another AJAX call to paginate if I already have one?
Because, if I click on the pagination link, Kaminari paginates the link into the entire page, instead of inside the div.
Hence, why I am using a partial within an AJAX called table div. However, I cannot go to the next page now or any other page. In my console, the correct queries are being made. When I actually right-click and open the page in a separate tab, I can change links (Only if I disable the rendering of the application and bootstrap layout).
One reason was just mentioned, the other I suspect, is that since I have a partial within another AJAX called view, the table actually won't update if I don't make an AJAX call to the table after I click another page for Kaminari.
To summarize:
index.html.erb
<div id="table"><div>
<script> $.ajax({
url: "http://localhost:3000/request/table",
type: "GET",
success: function(data) {
$("#table").html(data);
}
});
</script>
show.html.erb
<table id="table">
<thead>
<tr>
<th> Boop! </th>
</tr>
</thead>
<tbody id="items">
<% render @items %>
</tbody>
<div id="paginator">
<%= paginate @items, :remote => true %>
<%= page_entries_info @items, :remote => true %>
</div>
</table>
<script>
$('#analytics').html('<%= escape_javascript render(@items) %>');
$('#paginator').html('<%= escape_javascript(paginate(@items, :remote => true).to_s) %>');
</script>
partial: _item.html.erb
<tr>
<td> item.name </td>
<td> item.date </td>
</tr>
In summary,
I can open the pagination links (1,2,3,... Next, Previous) in a separate tab or as a full page url. I cannot update table by clicking pagination links.