{"action":"created","issue":{"url":"https://api.github.com/repos/mislav/will_paginate/issues/575","repository_url":"https://api.github.com/repos/mislav/will_paginate","labels_url":"https://api.github.com/repos/mislav/will_paginate/issues/575/labels{/name}","comments_url":"https://api.github.com/repos/mislav/will_paginate/issues/575/comments","events_url":"https://api.github.com/repos/mislav/will_paginate/issues/575/events","html_url":"https://github.com/mislav/will_paginate/issues/575","id":331360888,"node_id":"MDU6SXNzdWUzMzEzNjA4ODg=","number":575,"title":"undefined method total_pages error total_pages for #<Comment::ActiveRecord_AssociationRelation:0x47f7540>","user":{"login":"Kevin-Meldau75","id":24420958,"node_id":"MDQ6VXNlcjI0NDIwOTU4","avatar_url":"https://avatars0.githubusercontent.com/u/24420958?v=4","gravatar_id":"","url":"https://api.github.com/users/Kevin-Meldau75","html_url":"https://github.com/Kevin-Meldau75","followers_url":"https://api.github.com/users/Kevin-Meldau75/followers","following_url":"https://api.github.com/users/Kevin-Meldau75/following{/other_user}","gists_url":"https://api.github.com/users/Kevin-Meldau75/gists{/gist_id}","starred_url":"https://api.github.com/users/Kevin-Meldau75/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kevin-Meldau75/subscriptions","organizations_url":"https://api.github.com/users/Kevin-Meldau75/orgs","repos_url":"https://api.github.com/users/Kevin-Meldau75/repos","events_url":"https://api.github.com/users/Kevin-Meldau75/events{/privacy}","received_events_url":"https://api.github.com/users/Kevin-Meldau75/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-11T21:42:47Z","updated_at":"2018-06-19T11:55:48Z","closed_at":null,"author_association":"NONE","body":"Hi, I’m having an issue with getting the ‘will_paginate’ gem to work. Here is the site I’m working on - https://kevin-meldau-my-test-store.herokuapp.com/products. This is the error I keep getting - https://snag.gy/BqEGAi.jpg\r\n\r\n**This is how I’ve loaded the gem:**\r\n1.\tAdded 'will_paginate', '~> 3.1.0' to my gem file then run bundle\r\n2.\tAdded this to my products controller:\r\n\r\ndef show\r\n@comments = @product.comments.order(\"created_at DESC\")\r\n@comments = @product.comments.paginate(page: params[:page], per_page: 5)\r\nend\r\n\r\n3.\tThen added this to my show.html.erb file:\r\n\r\n<%= will_paginate @comments %>\r\n\r\n**Any help would be greatly appreciated! All the best, Kevin**\r\n"},"comment":{"url":"https://api.github.com/repos/mislav/will_paginate/issues/comments/398372914","html_url":"https://github.com/mislav/will_paginate/issues/575#issuecomment-398372914","issue_url":"https://api.github.com/repos/mislav/will_paginate/issues/575","id":398372914,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODM3MjkxNA==","user":{"login":"timkrins","id":531798,"node_id":"MDQ6VXNlcjUzMTc5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/531798?v=4","gravatar_id":"","url":"https://api.github.com/users/timkrins","html_url":"https://github.com/timkrins","followers_url":"https://api.github.com/users/timkrins/followers","following_url":"https://api.github.com/users/timkrins/following{/other_user}","gists_url":"https://api.github.com/users/timkrins/gists{/gist_id}","starred_url":"https://api.github.com/users/timkrins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timkrins/subscriptions","organizations_url":"https://api.github.com/users/timkrins/orgs","repos_url":"https://api.github.com/users/timkrins/repos","events_url":"https://api.github.com/users/timkrins/events{/privacy}","received_events_url":"https://api.github.com/users/timkrins/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T11:55:48Z","updated_at":"2018-06-19T11:55:48Z","author_association":"NONE","body":"Maybe try\r\n\r\n    def show\r\n      @comments = @product.comments\r\n        .order(created_at: :desc)\r\n        .paginate(page: params[:page], per_page: 5, total_pages: @product.comments.count)\r\n    end\r\n\r\nMight be something to do with the way your relation is configured on the product."}}
{"actor":{"display_login":"timkrins"}}