I have this controller in Scala:
def commonRedirect(anId: Long) = { implicit val aRule = CommonClient.getTheRule(anId) aRule match { case false โ Redirect("/general-rule/" + anId) case true โ Redirect("/custom-rule/" + anId) }
}
but this leads to the error: "It is not possible to use a method that returns play.api.mvc.Result as a handler for requests."
If I applied Action Builder, it works, but this is not the way I want.
Any ideas to solve this problem?
Thanks.
Lucas source share