Advertisement
Guest User

Untitled

a guest
Aug 13th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.27 KB | None | 0 0
  1.   private def unmarshalResource[A <% Resource]
  2.     (block: A => Result)
  3.     (implicit reads: Reads[A],
  4.               request: Request[JsValue]): Result =
  5.     request.body.validate[A].fold(
  6.       valid   = block,
  7.       invalid = { e => BadRequest(e.mkString) }
  8.     )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement