Howto render a list of objects with mustache

269 views
Skip to first unread message

Shimi Kiviti

unread,
Oct 31, 2011, 4:16:51 PM10/31/11
to sca...@googlegroups.com
Lets say I have a Person class
case class Person(fname: String, lname: String, age: Int)

and I want to render a list of Persons
Map("persons" -> List(person1, person2, person3))

How should the template look?
I know I need to use {{#persons}} {{/persons}} but what goes in between?

Shimi

Shimi Kiviti

unread,
Nov 1, 2011, 6:36:37 AM11/1/11
to Scalate
I have no idea why it didn't work yesterday. I guess I needed to
sleep.
{{#persons}}
{{fname}} {{lname}} {{age}}
{{/persons}}

works

James Strachan

unread,
Nov 3, 2011, 7:28:50 AM11/3/11
to sca...@googlegroups.com
Glad its working now though :)

--
James
-------
FuseSource
Email: ja...@fusesource.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration and Messaging

Reply all
Reply to author
Forward
0 new messages