Skip to content

Instantly share code, notes, and snippets.

@thesamet
Created November 11, 2013 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thesamet/7419702 to your computer and use it in GitHub Desktop.
Save thesamet/7419702 to your computer and use it in GitHub Desktop.
Filter JS serialization
package controllers
import play.api.libs.json.Json
class Test {
case class Filter(id: Int, table: String, name: String, Type: String, structure: String)
implicit val filterWrites = Json.writes[Filter]
def tojs = {
val l: List[Filter] = List(Filter(3, "4", "5", "6", "7"))
Json.toJson(l)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment