Skip to content

Instantly share code, notes, and snippets.

@dhoss
Forked from anonymous/Application.scala
Last active December 11, 2015 08:48
Show Gist options
  • Save dhoss/4575418 to your computer and use it in GitHub Desktop.
Save dhoss/4575418 to your computer and use it in GitHub Desktop.
package controllers
import play.api._
import play.api.mvc._
import org.squeryl.PrimitiveTypeMode._
import models.{Database, FrontPageUpdate}
import com.codahale.jerkson.Json
object Application extends Controller {
def index = Action {
val updates = Database.frontPageUpdates
views.html.index(updates.all())
}
}
value all is not a member of org.squeryl.Query[models.FrontPageUpdate]
In /Users/daustin/web-dev/lumos-pottery/app/controllers/Application.scala at line 16.
12 val updates = from(Database.frontPageUpdates)(
13 u => select(u)
14 orderBy(u.created_on desc)
15 )
16 Ok(views.html.index(updates.all))
17 }
@(updates: List[FrontPageUpdate])
@import helper._
@main("Lumos Pottery") {
<script src="@routes.Assets.at("javascripts/index.min.js")" type="text/javascript"></script>
<div id="welcome">Welcome text goes here</div>
<div id="updates">
<ul>
@updates.map { update =>
<li>@update.title</li>
}
</ul>
</div>
}
package controllers
import play.api._
import play.api.mvc._
import org.squeryl.PrimitiveTypeMode._
import models.{Database, FrontPageUpdate}
import com.codahale.jerkson.Json
object Application extends Controller {
def index = Action {
val updates = Database.frontPageUpdates
views.html.index(updates.all())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment