Skip to content

Commit

Permalink
fill the original empty template with nested-repeat element
Browse files Browse the repository at this point in the history
json code's spelling mistake
  • Loading branch information
trydofor committed Jul 30, 2015
1 parent af62ebb commit ff4c5ef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Expand Up @@ -5,3 +5,5 @@ GET /contacts/:id controllers.Application.showContact(id:Int)
POST /user controllers.Application.userPost

POST /submit controllers.Application.submit

POST /contact/save controllers.Application.saveContact
@@ -1,3 +1,20 @@
@(contactForm: Form[Contact])
@(contactForm: Form[Contact])(implicit messages: Messages)

@import scalaguide.forms.scalaforms.controllers.routes

@helper.form(action = routes.Application.saveContact) {

@helper.inputText(contactForm("firstname"))
@helper.inputText(contactForm("lastname"))
@helper.inputText(contactForm("company"))

@helper.repeat(contactForm("informations")) { info =>
@helper.inputText(info("label"))
@helper.inputText(info("email"))
@helper.repeat(info("phones")) { phone =>
@helper.inputText(phone)
}
}

<input type="submit" id="submit" value="@routes.Application.saveContact">
}
Expand Up @@ -92,7 +92,7 @@ In the code samples below, we’ll use the following JSON:
"key2" : {
"key21" : 123,
"key22" : true,
"key23" : [ "alpha", "beta", "gamma"]
"key23" : [ "alpha", "beta", "gamma"],
"key24" : {
"key241" : 234.123,
"key242" : "value242"
Expand Down

0 comments on commit ff4c5ef

Please sign in to comment.