Skip to content

Commit

Permalink
docs: router, fix scope w custom helper name example typo (#5929)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordannb authored Sep 12, 2024
1 parent 2343111 commit 48ee8cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/phoenix/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ defmodule Phoenix.Router do
Scopes allow us to scope on any path or even on the helper name:
scope "/v1", MyAppWeb, host: "api." do
scope "/api/v1", MyAppWeb, as: :api_v1 do
get "/pages/:id", PageController, :show
end
For example, the route above will match on the path `"/api/v1/pages/1"`
and the named route will be `api_v1_page_path`, as expected from the
values given to `scope/2` option.
and the named helper will be `api_v1_page_path`, as expected from the
values given to `scope/4` option.
Like all paths you can define dynamic segments that will be applied as
Like all paths, you can define dynamic segments that will be applied as
parameters in the controller:
scope "/api/:version", MyAppWeb do
Expand Down

0 comments on commit 48ee8cc

Please sign in to comment.