I have the next controller
object MyController extends RestHelper {
serve {
case "name" :: name :: _ Get _ =>
if (name == "adam") {
//should render template adam.html
} else {
//should render other.html
}
}
}
How to lift work with it?
I'd think you should be able to use something like this:
Templates.apply("adam" :: Nil) match {
case Full(ns) => XhtmlResponse(ns)
case _ => NotFoundResponse("404 - Template Not Found")
}
Though, two things - if you're just rendering pages - why not use lift's built in SiteMap? It handles a lot of the error conditions and such for you. Also, you may want to consider making that two different rules, it may be easier to follow later on with something like this:
case "name" :: "adam" :: _ Get _ => //render adam.html
case "name" :: _ :: _ Get _ => //render other