Skip to content

Instantly share code, notes, and snippets.

@icambridge
Created December 24, 2012 18:43
Show Gist options
  • Save icambridge/4370322 to your computer and use it in GitHub Desktop.
Save icambridge/4370322 to your computer and use it in GitHub Desktop.
Play! 2 Form binding
def save = Action { implicit request =>
val result = postForm.bindFromRequest.fold(
{formFail => Ok(views.html.admin.blog.edit(formFail))},
{post => Ok(views.html.blog.post(post))}
)
result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment