Created
January 8, 2013 14:48
-
-
Save benoit-ponsero/4484313 to your computer and use it in GitHub Desktop.
@repeatWithIndex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@(field:Field, min:Int=1)(f: (Field, Int) => Html) | |
@{ | |
(0 until math.max(if (field.indexes.isEmpty) 0 else field.indexes.max + 1, min)).map(i => f(field("[" + i + "]"),i)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@repeatWithIndex(myForm("field"), min=1) { (field, index) => | |
@index | |
@helper.inputText(field("another_field")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get's my vote... ran into a situation that required exactly this...