Sorry I was unclear. Nothing actually goes
wrong per se, and I certainly have looked at the samples. Let me try to be more clear on my problem.
The problem is I can't figure out how to get anything but a hardcoded title to the main template.
In my example I had this:
What if I don't want the title to be a hardcoded value "Person"? I want to "calculate" the title--basically according to whether this is a "create person" form or an "edit person" form.
I have tried this at the top of the template:
@(title: String)(personForm: Form[PersonData])
(where
title then gets passed to
main) and then this in the controller
Ok(views.html.persons.profile("Desired title", personForm.fill(PersonData(...)))
Then I get a compilation error:
too many arguments for method apply: (title: String)(personForm: play.api.data.Form[controllers.personData])play.api.templates.HtmlFormat.Appendable in object profile
I have also seen this in the samples:
But I have no desire to generate new HTML. I just want to control the string that gets sent to the main template via some logic rather than a hardcoded string.
Hopefully this helps clarify. This seems way too simple to be causing a problem.
Thanks.