Compilation error of Play framework Templates
Asked Answered
M

2

5

hi i am trying to display a form and following a proper tutorial.. But i am getting compilation error which is..

missing arguments for method apply in object form; follow this method with `_' if you want to treat it as a partially applied function

My template look like this

@main("Example"){
    <h1>SignUp Form</h1>

    @helper.form(action = routes.Application.submit()) 
    {
        @helper.inputText(signupform("name"))
        @helper.inputText(signupform("password"))
        <input type="submit" value="Signup" />
    }
}
Moidore answered 22/8, 2012 at 9:56 Comment(0)
M
9

Your braces are wrong...

@helper.form(action = routes.Application.submit()) {
  @helper.inputText(signupform("name"))
  @helper.inputText(signupform("password"))
  <input type="submit" value="Signup" />
}
Maurey answered 22/8, 2012 at 11:3 Comment(3)
Yeah the parser is less complex than the real Scala parser. If this answer solved your problem, please accept it.Maurey
I would like to know why this must be on that way? At least, where i can find a good reason for play to work on that way.Deplorable
It's an implementation detail - the way Play parses templates using a Scala parser combinator.Maurey
B
0

signupform is not defined. Use below format in first line to define signupform:

@(signupform: Form[_])
Broadwater answered 21/6, 2017 at 9:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.