0

I'm getting started with scalatra and jade, but my views which match a route come
wrapped in <pre></pre> tags.
My project is setup like so:

//ScalatraServlet.scala
def get("/index") {
  jade("index")
}

//WEB-INF/templates/views/index.jade
h1 Indexing.

//WEB-INF/templates/views/no_route.jade
h1 works correctly!

If I hit localhost:8080/index on the browser, it shows the whole html structure inside <pre></pre> tags, but if I hit localhost:8080/test, which doesn't have a route defined for it in scalatra, it renders correctly. What am I doing wrong? Is there a caveat to working with routes and jade?

1 Answers1

0

Have you tried adding the contentType before calling jade(...) ?

def get("/index") {
  contentType="text/html"
  jade("index")
}
Sami Jaber
  • 51
  • 3