Created
February 11, 2015 14:30
-
-
Save mikesname/7baece8eb46e7f8e4a3c to your computer and use it in GitHub Desktop.
Play Slick question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.db.slick.DB | |
def allSamplesJson = Action { implicit request => | |
request.session.get("l").map { | |
case "i" => DB.withSession { implicit dbs => | |
val all = models.CodeSampleTable.allSamples() | |
Ok(Json.toJson(all)) | |
} | |
case _ => Unauthorized(unautStr) | |
}.getOrElse { | |
Unauthorized(unautStr) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment