How to define function literal with multiple implicit arguments in Scala? I\'ve tried this way:
def create = authAction { (implicit request, user) ⇒ // Synta
Just had a similar situation as you, implementing an authAction function in Play that would easily pass a user in. You can do it like lambdas did it, with currying; I ended up making my authAction function receive the RequestHeader implicitly, but pass in both request and user explicitly:
def authAction(f: (RequestHeader, User) => Result)(implicit request: RequestHeader) = {
...
val authUser = loadUser(...)
f(request, authUser)
}
And to use it:
def create = authAction { (request, user) =>
Ok(html.user.create(registrationForm))
}