Skip to content

Instantly share code, notes, and snippets.

@aaronlifton3
Created December 17, 2012 05:08
Show Gist options
  • Select an option

  • Save aaronlifton3/4315881 to your computer and use it in GitHub Desktop.

Select an option

Save aaronlifton3/4315881 to your computer and use it in GitHub Desktop.
play 2.0 scala form helper salat mongodb example
@(posts: List[Post], postForm: Form[Post])(implicit flash: Flash)
@main(Messages("posts.list")) {
<dl class="posts">
@for(post <- posts) {
<dt>
<a href="@controllers.routes.Posts.view(post.id)">@post.name</a>
</dt>
<dd>@post.description</dd>
}
</dl>
<p><a href="@controllers.routes.Posts.create()" class="btn">
<span class="icon-plus"></span> @Messages("posts.new.command")</a></p>
@helper.form(routes.Posts.create) {
@helper.inputText(postForm("name"))
@helper.inputText(postForm("description"))
@helper.inputText(postForm("group_id"))
<input type="submit" value="Create">
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment