tags:

views:

68

answers:

1

I've look around and see a few plugins that do this, but I'm surprised it's not built into the language, outside of the scaffolding.

In Django, for example, you can say

<form action="/contact/" method="POST">
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>

and get a reasonable form for a model, based on the model definitions and additional names and hints you can supply.

Is there any equivalent way of doing this in Grails?

+2  A: 

Not within grails core.

The closest I can think of would be:

class BookController {
   def scaffold = true
}

then

<g:include controller="Book" action="edit"/>

You can also call

<g:render template="/book/edit" model="[book:mybook]"/>

but the functionality you've described does not exist.

tomas