Rails 可以映射在逻辑上属于其他资源的子资源的资源,例如在 URL 中
/magazines/:magazine_id/ads/:id show display a specific ad belonging to a specific magazine
是否可以在游戏中执行此操作?
最佳答案
Play 不在乎参数是否代表某种关系,这是 Controller 的工作。
当然可以这样做:
GET /some/:parent/:child controllers.Application.getRelated(parent: Long, child: Long)
在 Controller 中:
public static Result getRelated(Long parent, Long child) {
return ok(SomeFinder(parent,child));
}
关于playframework - Play Framework 是否支持像 rails 这样的嵌套路由?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11207503/