score:2

Accepted answer

For sure you can. You can use TWIRL templates:

Create a template "views/Application/contacts.scala.html

@(users: List[User])

<h1>Users</h1>

<ul>
@for(user <- users) {
  <li>@user.name</li>
}
</ul>

in the controller:

Ok(views.html.Application.contacts(users))

Related Query

More Query from same tag