I didn't notice default.scaml
in the layouts folder. It was defining, but not setting, title
.
Value not set error in Scalate/Jade
Question
I am new to Jade and Scalate. I have the following route defined:
get("/") {
jade("index",
"pageTitle" -> "Welcome to Jade",
"welcomeMessage" -> "Hello my pretties")
}
And the template:
-@ val pageTitle: String
-@ val welcomeMessage: String
!!! 5
html(lang="en")
head
title= pageTitle
body
h1= welcomeMessage
The error I get on page render is:
The value for 'title' was not set
org.fusesource.scalate.NoValueSetException: The value for 'title' was not set
at org.fusesource.scalate.RenderContext$$anonfun$attribute$1.apply(RenderContext.scala:159)
Even if I remove the line title= pageTitle
I still get the error. What is the error referring to and how do I fix it?
Solution
OTHER TIPS
You could also do a clean build with SBT as follows.
sbt clean clean-files
Note: You need to exit SBT first.
I had a similar value-not-set error for a different reason but this command helped me resolve the problem.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow