When I run mix phx.gen.html I want to create a resource “shipping” that’s also nested. Unfortunately this complicates the _path function that’s used in many places.
I tried running
mix phx.gen.html Shipments Shipment shipments
but this creates a simple shipment_path in all of the files that then breaks the code and doesn’t allow me to run mix phx.routes, for example, making it hard to even see what the route would be. Is there a standard way to run the mix phx.gen.html command with nested resources?
I don’t think such functionality exists in the generators.
Also when you run the generators you are advised to create the routes in the router yourself by adding code like below yourself.
resources "/groups", GroupController
Generators are there to help, but i think nested resources need to be taken care of manually.
as a follow up I realized I can change this to groups_addresses_path because that’s the path phoenix uses with other nested resources I have. Why doesn’t it still find the function if I replace all shipment_path() to groups_shipment_path()