public
Created

Filter JS serialization

  • Download Gist
gistfile1.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 
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)
}
 
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.