I’ve seen serval similar posts about this around here but I can’t find my exact problem.
I have a --live
generate app which nests an Admin
module in the web app with standard, non-live controllers. I use the html generator like so:
$ mix phx.gen.html --binary_id --web admin Admin.Pages Page pages example_field:string
This generates exactly what I want from a module and file structure standpoint. It creates a MyApp.Admin.Pages.Page
domain module and a MyAppWeb.Admin.PageController
web module written to lib/my_app_web/admin/page_controller.ex
. So far so good! The generated templates use Routes.admin_page_path
helpers which is also what I expect.
However…
When I update my router to look like this:
scope "/", MyAppWeb do
pipe_through :browser
live "/", HomeLive, :index
scope "/admin", Admin do
resources "/pages", PageController
end
end
or even like this:
scope "/", MyAppWeb do
pipe_through :browser
live "/", HomeLive, :index
end
scope "/admin", MyAppWeb.Admin do
pipe_through :browser
resources "/pages", PageController
end
…Phoenix generates route helpers for page
without the admin_
prefix!
I’m using Phoenix 1.5.3.