Given the list of foobars (each of which contains the name and pool used to create the URL hyperlink), what would be the idiomatic way in the Play 2.0 template for each element in this list to refer to a link (or some other HTML), and then rearrange a list with some kind of character, such a comma?
For example, if there were three foobars, the final output might look like this:
<a href="/quux/foobar1">Foobar1</a>, <a href="/quux/foobar2">Foobar2</a>, <a href="/quux/foobar3">Foobar3</a>
My first impulse was to try:
@foobars.map{foobar => <a href="@routes.Foobars.quux(foobar.slug)">@foobar.name</a> }.mkString(", ")
but this leads to HTML escaping, which I don't want.
This seems to be a common use case; Is there an idiomatic way this can be achieved?
source share