brecabral
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explaining what the problem is.
I looked at the history of this section and found that an older version of the documentation contained an explanation immediately after this part. It said:
“We can fix this problem by adding an
as: :adminoption to our admin scope:”
followed by:
scope "/admin", HelloWeb.Admin, as: :admin do
pipe_through :browser
resources "/reviews", ReviewController
end
From the older documentation, it appears that the problem being referred to was the generated path helpers having the same name, such as review_path.
My question is whether this problem still exists in the current Phoenix version.
If it has been resolved at some point, should the current documentation still mention “but there is a problem”, or should that statement be removed/updated?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Marked As Solved- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
rhcarvalho
Hi Breno, welcome to the Elixir community and the Forum!
Indeed, in Phoenix 1.7+, route helpers were replaced with Verified Routes (e.g.
~p"/reviews"), making helper name collisions irrelevant. That transition sentence ("This looks good, but there is a problem here...") was accidentally left behind without the original context explaining helper name collisions.I’m sure a docs PR would be very welcome.
If you haven’t figured it out yet, the documentation has links that take you directly to the source code:
The particular sentence is still there in
main:Also Liked
josevalim
It has been resolved since path helpers are deprecated. It seems it is already no longer there on more recent versions of the documentation!
brecabral
Thanks for the explanation! I opened a PR to remove the outdated statement: PR link
Hope it helps with the project!
brecabral
Wow, first of all, I didn’t expect to get a response from José Valim himself. Thanks!
Second, I just started learning Elixir/Phoenix, so I’m going through the documentation. When I read “but there is a problem”, I started looking for an explanation and a solution to that problem.
The guide at
/main/guides/routing.mdon line321, still has the same text.Maybe I’m just misunderstanding what you mean — English isn’t my native language — but is the problem you were referring to something else? For example, is it about having both the admin routes and the regular user-facing routes?
Because that is actually the behavior I would expect, and I don’t see it as a problem. Or there is a even more recent versions of the documentation?