I'm trying to call render from a controller for a tag (function) inside a template instead of the template. This way I could use it for partial renderings of a page from ajax calls. Of course I could separate the components of the form in several templates an call render on those but I think it would be cleaner the other way.
What I was trying to do is like the following:
formpage.scala.htm
@()
<html>
...
@content
...
</html>
@**********************************
* Helper generating form *
***********************************@
@content() = {
<h3 class="form-heading">@Messages("employees")</h3>
@form(routes.AppController.save()) {
@inputText...
...
}
And using ajax render the content function, without having to separate it to a separate file. This way I could render portions of the template without fragmenting it in multiple files.