Great catch! We'd supported handling None properly (like null) for the
longest time, but were not unwrapping the Some.
I've raised this issue
http://www.assembla.com/spaces/scalate/support/tickets/197
Its always surprised me a little that Option doesn't implement
Traversable, so I've also raised this issue so that when using an
Option[Person] value you can use it in a mustache section / inverted
section to iterate over a complex object wrapped in an Option
http://www.assembla.com/spaces/scalate/support/tickets/198
Both these issues are now resolved in master. See the test case for
more detail...
https://github.com/scalate/scalate/blob/master/scalate-core/src/test/scala/org/fusesource/scalate/mustache/OptionTest.scala#L26
Incidentally if you're ever wondering how Mustache navigates object
contexts and implements sections, its all in this Scope.scala file..
https://github.com/scalate/scalate/blob/master/scalate-core/src/main/scala/org/fusesource/scalate/mustache/Scope.scala
And here's the generic Scalate way we turn values into markup/output
handling null & None (and now Some) etc
https://github.com/scalate/scalate/blob/master/scalate-core/src/main/scala/org/fusesource/scalate/RenderContext.scala#L193
--
James
-------
FuseSource
Email: ja...@fusesource.com
Web: http://fusesource.com
Twitter: jstrachan
Blog: http://macstrac.blogspot.com/
Open Source Integration