Reputation: 849
I have this line of code:
Ok(views.html.main("Title",views.html.userShow(user)))
According to the debugger views.html.userShow(user) returns a Html object.
main2 starts with
@(title: String)(content: play.twirl.api.Html)
Now I get the error message:
too many arguments for method apply: (title: String)(content: play.twirl.api.Html)play.twirl.api.HtmlFormat.Appendable in object main2
What is wrong with this code?
Upvotes: 3
Views: 4036
Reputation: 55569
The declaration for the main
view is using curried parameters:
@(title: String)(content: play.twirl.api.Html)
Which means you'd have to pass them like this:
Ok(views.html.main("Title")(views.html.userShow(user)))
The error is thrown because you're trying to pass too many parameters to the first grouping.
Alternatively, change the parameters of the main
view to not be curried:
@(title: String, content: play.twirl.api.Html)
Upvotes: 6