{"action":"created","issue":{"url":"https://api.github.com/repos/mgwidmann/scrivener_html/issues/37","repository_url":"https://api.github.com/repos/mgwidmann/scrivener_html","labels_url":"https://api.github.com/repos/mgwidmann/scrivener_html/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/mgwidmann/scrivener_html/issues/37/comments","events_url":"https://api.github.com/repos/mgwidmann/scrivener_html/issues/37/events","html_url":"https://github.com/mgwidmann/scrivener_html/issues/37","id":174896142,"number":37,"title":"protocol Phoenix.Param not implemented for [page: 1]","user":{"login":"yamzalal","id":1648092,"avatar_url":"https://avatars.githubusercontent.com/u/1648092?v=3","gravatar_id":"","url":"https://api.github.com/users/yamzalal","html_url":"https://github.com/yamzalal","followers_url":"https://api.github.com/users/yamzalal/followers","following_url":"https://api.github.com/users/yamzalal/following{/other_user}","gists_url":"https://api.github.com/users/yamzalal/gists{/gist_id}","starred_url":"https://api.github.com/users/yamzalal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamzalal/subscriptions","organizations_url":"https://api.github.com/users/yamzalal/orgs","repos_url":"https://api.github.com/users/yamzalal/repos","events_url":"https://api.github.com/users/yamzalal/events{/privacy}","received_events_url":"https://api.github.com/users/yamzalal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-03T13:08:20Z","updated_at":"2016-11-14T04:42:21Z","closed_at":"2016-11-13T02:04:22Z","body":"I have added the following in my template\n\n`<%= pagination_links @conn, @posts, path: &profile_path/3, action: :videos %>`\n\nMy function in the controller looks like below\n\n```\ndef videos(conn, params) do\n    user_id = params[\"user_id\"]\n    user = load_user(user_id)\n    posts = Post\n            |> where([p], p.user_id == ^user.id)\n            |> where([p], p.type == 1)\n            |> order_by(desc: :inserted_at)\n            |> preload([{:user, :personal_detail}])\n            |> Repo.paginate(params)\n   render(conn, \"videos.html\", posts: posts, user: user,)\nend\n```\n\nRoutes for the videos is http://localhost:4000/profiles/1/videos/?page=1\n\n```\nscope \"/\", SampleProject do\n    pipe_through [:browser, :require_authentication]\n    get \"/profiles/:user_id/videos\", ProfileController, :videos\nend\n```\n\nI get this error:\n\n`protocol Phoenix.Param not implemented for [page: 1]`\n"},"comment":{"url":"https://api.github.com/repos/mgwidmann/scrivener_html/issues/comments/260247271","html_url":"https://github.com/mgwidmann/scrivener_html/issues/37#issuecomment-260247271","issue_url":"https://api.github.com/repos/mgwidmann/scrivener_html/issues/37","id":260247271,"user":{"login":"yamzalal","id":1648092,"avatar_url":"https://avatars.githubusercontent.com/u/1648092?v=3","gravatar_id":"","url":"https://api.github.com/users/yamzalal","html_url":"https://github.com/yamzalal","followers_url":"https://api.github.com/users/yamzalal/followers","following_url":"https://api.github.com/users/yamzalal/following{/other_user}","gists_url":"https://api.github.com/users/yamzalal/gists{/gist_id}","starred_url":"https://api.github.com/users/yamzalal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamzalal/subscriptions","organizations_url":"https://api.github.com/users/yamzalal/orgs","repos_url":"https://api.github.com/users/yamzalal/repos","events_url":"https://api.github.com/users/yamzalal/events{/privacy}","received_events_url":"https://api.github.com/users/yamzalal/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T04:42:21Z","updated_at":"2016-11-14T04:42:21Z","body":"sorry for the delay in my reply and thanks for your efforts. Not sure this is the right way, but this is how i have fixed the issue. Manually added paginations variables in the render function.\r\n\r\n`render(conn, \"videos.html\", posts: posts, user: user, page_number: posts.page_number, total_pages: posts.total_pages, total_entries: posts.total_entries)`\r\n\r\nCreated a custom function\r\n\r\n```\r\ndef custom_pagination_links(total_pages, page_number, total_entries) do\r\n      # print pagination only when total entries is more than 6\r\n      if total_entries >= 6 do\r\n        Scrivener.HTML.pagination_links(%Scrivener.Page{total_pages: total_pages, page_number: page_number}, view_style: :bootstrap_v4)\r\n      end\r\n    end\r\n```\r\n\r\nIn template file, called the function\r\n`<%= custom_pagination_links(@total_pages, @page_number, @total_entries) %>`"}}
{"actor":{"display_login":"yamzalal"}}