{"action":"opened","issue":{"url":"https://api.github.com/repos/amatsuda/kaminari/issues/814","repository_url":"https://api.github.com/repos/amatsuda/kaminari","labels_url":"https://api.github.com/repos/amatsuda/kaminari/issues/814/labels{/name}","comments_url":"https://api.github.com/repos/amatsuda/kaminari/issues/814/comments","events_url":"https://api.github.com/repos/amatsuda/kaminari/issues/814/events","html_url":"https://github.com/amatsuda/kaminari/issues/814","id":172387797,"number":814,"title":"Paginate posts which are displayed with Ajax","user":{"login":"MatthiasRMS","id":13106445,"avatar_url":"https://avatars.githubusercontent.com/u/13106445?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthiasRMS","html_url":"https://github.com/MatthiasRMS","followers_url":"https://api.github.com/users/MatthiasRMS/followers","following_url":"https://api.github.com/users/MatthiasRMS/following{/other_user}","gists_url":"https://api.github.com/users/MatthiasRMS/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthiasRMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthiasRMS/subscriptions","organizations_url":"https://api.github.com/users/MatthiasRMS/orgs","repos_url":"https://api.github.com/users/MatthiasRMS/repos","events_url":"https://api.github.com/users/MatthiasRMS/events{/privacy}","received_events_url":"https://api.github.com/users/MatthiasRMS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-22T07:44:15Z","updated_at":"2016-08-22T07:44:15Z","closed_at":null,"body":"In my rails app, I am rendering posts with ajax:\r\n\r\n    <%= link_to explore_posts_path, remote: true %>\r\n\r\nIn my controller:\r\n\r\ndef explore \r\n  @posts = Post.all\r\n  respond_to do |format|\r\n   format.js\r\n  end\r\nend \r\n\r\nIn explore.js.erb:\r\n\r\n    $('.explore-wrapper').append('\\\r\n        <div class=\"explore-posts col-xs-9\">\\\r\n    \t\t<%= j render @posts %>\\\r\n        </div>\\\r\n      ');\r\n\r\nHowever, I'd like to paginate those posts with Kaminari. I managed to have Kaminari to work in my app on other pages, but posts weren't displayed with AJAX, they were displayed on page load.\r\n\r\nI changed my explore.js.erb file:\r\n\r\n    $('.explore-wrapper').append('\\\r\n        <div class=\"explore-posts col-xs-9\">\\\r\n    \t\t<%= j render @posts %>\\\r\n    \t\t<%= paginate @posts %>\\\r\n        </div>\\\r\n      ');\r\n\r\nBut now there aren't any posts displayed, so it \"broke\" the callback.\r\n\r\nHow can I display with AJAX paginated posts ? \r\n "}}
{"actor":{"display_login":"MatthiasRMS"}}