{"action":"created","issue":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2019","repository_url":"https://api.github.com/repos/phoenixframework/phoenix","labels_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2019/labels{/name}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2019/comments","events_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2019/events","html_url":"https://github.com/phoenixframework/phoenix/pull/2019","id":193038022,"number":2019,"title":"Introduce current_path and current_url","user":{"login":"chrismccord","id":576796,"avatar_url":"https://avatars.githubusercontent.com/u/576796?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismccord","html_url":"https://github.com/chrismccord","followers_url":"https://api.github.com/users/chrismccord/followers","following_url":"https://api.github.com/users/chrismccord/following{/other_user}","gists_url":"https://api.github.com/users/chrismccord/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismccord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismccord/subscriptions","organizations_url":"https://api.github.com/users/chrismccord/orgs","repos_url":"https://api.github.com/users/chrismccord/repos","events_url":"https://api.github.com/users/chrismccord/events{/privacy}","received_events_url":"https://api.github.com/users/chrismccord/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-02T05:34:19Z","updated_at":"2016-12-02T11:51:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/phoenixframework/phoenix/pulls/2019","html_url":"https://github.com/phoenixframework/phoenix/pull/2019","diff_url":"https://github.com/phoenixframework/phoenix/pull/2019.diff","patch_url":"https://github.com/phoenixframework/phoenix/pull/2019.patch"},"body":"@josevalim I wasn't sure the best place for these to live. My first goto was the Router.Helpers, but there is no need for us to inject the functions, and the module itself is private (moduledoc false). They are also more discoverable on Phoenix.Controller, but we'll have to import them in web.ex/view, or have folks import as needed. Wdyt?"},"comment":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/comments/264437889","html_url":"https://github.com/phoenixframework/phoenix/pull/2019#issuecomment-264437889","issue_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2019","id":264437889,"user":{"login":"chrismccord","id":576796,"avatar_url":"https://avatars.githubusercontent.com/u/576796?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismccord","html_url":"https://github.com/chrismccord","followers_url":"https://api.github.com/users/chrismccord/followers","following_url":"https://api.github.com/users/chrismccord/following{/other_user}","gists_url":"https://api.github.com/users/chrismccord/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismccord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismccord/subscriptions","organizations_url":"https://api.github.com/users/chrismccord/orgs","repos_url":"https://api.github.com/users/chrismccord/repos","events_url":"https://api.github.com/users/chrismccord/events{/privacy}","received_events_url":"https://api.github.com/users/chrismccord/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T11:51:37Z","updated_at":"2016-12-02T11:51:37Z","body":"Scheme is definitely needed. Will make the change, nuke endpoint, and always include /\n\nSent from my iPhone\n\n> On Dec 2, 2016, at 5:51 AM, José Valim <notifications@github.com> wrote:\n> \n> @josevalim commented on this pull request.\n> \n> In lib/phoenix/controller.ex:\n> \n> > +      \"www.endpoint2.example.com/users/123\"\n> +  \"\"\"\n> +  def current_url(%Plug.Conn{} = conn) do\n> +    current_url(conn, endpoint_module(conn))\n> +  end\n> +  def current_url(%Plug.Conn{} = conn, %{} = params) do\n> +    current_url(conn, endpoint_module(conn), params)\n> +  end\n> +  def current_url(%Plug.Conn{} = conn, endpoint) when is_atom(endpoint) do\n> +    Path.join(endpoint.url(), current_path(conn))\n> +  end\n> +  def current_url(%Plug.Conn{} = conn, endpoint, %{} = params) when is_atom(endpoint) do\n> +    Path.join(endpoint.url(), current_path(conn, params))\n> +  end\n> +\n> +\n> ✂️ maybe?\n> \n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n"}}
{"actor":{"display_login":"chrismccord"}}