Skip to content

Instantly share code, notes, and snippets.

@zidarsk8
Created February 20, 2013 01:50
Show Gist options
  • Save zidarsk8/4992029 to your computer and use it in GitHub Desktop.
Save zidarsk8/4992029 to your computer and use it in GitHub Desktop.
i am a bad bad person
def remove(id: String) = Action { implicit request =>
// user match {
// case Some(u) => {
// Users.remove(id)
// Redirect(routes.Application.index()).flashing("message" -> "User Deleted!")
// }
// case None => {
// Redirect(routes.Application.index()).flashing("message" -> "You can't do that! You're a bad perosn")
// }
// }
// Do not look down!
Redirect(routes.Application.index()).flashing(user match {
case Some(u) => {
Users.remove(id)
("message" -> "User Deleted!")
}
case None => {
("message" -> "You can't do that! You're a bad perosn")
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment