Witam!
Jak w temacie chcialem dodac ajax do paginacji Kaminari. Sama paginacja bez ajax dziala tylko chyba problem jest w bibliotekach. Wykorzystuje rails 3.2.7
<!DOCTYPE html>
<html>
<head>
<title>Testapp</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
</head>
...
application.js
//= require jquery
//= require jquery_ujs
//= require_tree .
index.html.erb
<h1>Listing posts</h1>
<table class="">
<thead>
<th>Photo</th>
<th>Name</th>
<th>Title</th>
<th>Content</th>
<th></th>
<th></th>
</thead>
<tbody id="posts">
<%= render @posts %>
</tbody>
</table>
<div id="paginator">
<%= paginate @posts, :remote => true %>
</div>
<br />
<%= link_to 'New Post', new_post_path %>
_post.html.erb
<tr>
<td><% if post.photos.first.nil? %>
<%= image_tag ("rails.png")%>
<% else %>
<%= image_tag (post.photos.first.image.url(:thumb)) %><% end %></td>
<td><%= post.name %></td>
<td><%= post.title %></td>
<td><%= post.content %></td>
<td><%= link_to 'Show', post %></td>
<td><%= link_to 'Edit', edit_post_path(post) %></td>
<td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
index.js.erb
$('#posts').html('<%= escape_javascript render(@posts) %>');
$('#paginator').html('<%= escape_javascript(paginate(@posts, :remote => true).to_s) %>');