List the many of a onetomany?

Showing 1-2 of 2 messages
List the many of a onetomany? MichielQ 6/26/11 10:35 AM
Hi all

I'm totally new to Lift (as well as Scala) and using the available
books and documentation online I'm developing my first app. So please
bear with me for my simplistic questions.

I'm trying to show an entity with a list of it's onetomany
relationship. Here's the code I have:

def listAll(xhtml: NodeSeq) = Serial.findAll.flatMap { a =>
  bind("serie", xhtml,
         "name" -> a.name,
         "episodes" -> a.episodes.map(_.name.toString).mkString(", ")
  )}

<ul class="lift:Series.listAll">
          <li><serie:name /> (<serie:episodes>)</li>
</ul>

The serie:name shows up but the episodes don't.

Can someone please tell me what .map(_.name.toString).mkString(", ")
does and how I can show this in the html?
This message has been hidden because it was flagged for abuse.