Routes with optional parameter - Play 2.1 Scala

前端 未结 5 931
旧巷少年郎
旧巷少年郎 2020-12-10 03:20

So in Play 2.0 I had this:

GET     /tasks/add              controllers.Tasks.addTask(parentId: Option[Long] = None)
GET     /tasks/:parentId/add    controlle         


        
5条回答
  •  清歌不尽
    2020-12-10 04:09

    I think you have to add a question mark:

    controllers.Tasks.addTask(parentId: Option[Long] ?= None)

提交回复
热议问题