Grails scaffolding improvement

Date August 27, 2008

I put together a small change to Grails’ scaffolding templates to help with one to many and many to many relationships.  Grails (well, GORM really) will manage these relationships under the hood, but you were always left to do the interface on your own.  This small set of file changes will give you better relationship management when you ‘generate all’ or ‘generate templates’ for you domains.

Here’s a small screenshot of what an editing screen looks like:

To use these, simply ‘grails install-templates’ in your project, replace the two files from the SVN repo (see link above) and generate away.  This only deals with editing right now, not the ‘create’ step.  That could be modified, I’m sure, I just didn’t do it (or did it but didn’t make it work right).  If you’d like to contribute to this project, let me know.

 Did you like this post? Buy me a hot chocolate!

4 Responses to “Grails scaffolding improvement”

  1. Graeme Rocher said:

    Patches welcome if you want it integrated into Grails core ;-)

  2. Steve said:

    Does not successfully execute “grails generate-all”. Error was:

    Could not execute method p.
    No such property: p for class: SimpleTemplateScript1

  3. mgkimsal said:

    Steve - what version of Grails are you using?

  4. Steve said:

    1.0.3 with JSecurity 0.3-SNAPSHOT and Searchable 0.5-SNAPSHOT

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">