I'm creating application using Scalatra and I'm using Scalate/Jade for templating. I try to add flash support to my application. I mixed FlashMapSupport
into into my Servlet and I'm able to access flash
helper. Anyway, if I'm trying to get it from layout I receive following error:
[error] /home/ytaras/projects/scala/scalatra-shopping-cart/target/scala-2.10/src_managed/main/scalate/templates/layouts/default_jade.scala:27: not found: value flash
[error] flash.get("alert").foreach
[error] ^
[error] one error found
The best I could do to avoid that was to use downcast to render context:
- context.asInstanceOf[org.scalatra.scalate.ScalatraRenderContext].flash.get("alert").foreach
- alert =>
.alert
.button(type="button" class="close" data-dismiss="alert") ×
= alert
Anyway, that's definitely not a prettiest solution. Is there something I can do to fix it or it's an issue in Scalate/Jade code?