假设我有这样一些路线:
GET /home/:id/foo controllers.HomeController.foo(id: Int)
GET /home/:id/bar controllers.HomeController.bar(id: Int)
GET /home/:id/baz controllers.HomeController.baz(id: Int)
我决定把它们分开归档。如果我像对其他没有动态部分的路由那样将其拆分,则这些路由将不再被识别,即使路由查找看起来是正确的:
Action Not Found
For request 'GET /home/1/foo'
These routes have been tried, in this order:
1 GET/home/$id<[^/]+>/foo controllers.HomeController.foo(id:Int)
2 GET/foo/$id<[^/]+> controllers.HomeController.foo(id:Int)
路线
-> /home/:id home.Routes
GET /foo/:id controllers.HomeController.foo(id: Int)
主页.路线
GET /foo controllers.HomeController.foo(id: Int)
GET /bar controllers.HomeController.bar(id: Int)
GET /baz controllers.HomeController.baz(id: Int))
有没有办法让这一切顺利进行,还是根本不可能?