Grails: tiene muchas dependencias

I have two Grails classes with a hasMany dependency:

class Author {

String name

static hasMany = [books: Book] 

I generated the controller with scaffolding its running and works. But is there a way to gernate a book within the the author controller? So there i can generate a author and some book without changing the view? Thanks in advance.

preguntado el 28 de mayo de 14 a las 13:05

1 Respuestas

The built in scaffolding templates for Grails do not have this ability. However, you can use the Grails command install-templates and modify/enhance the templates to have this ability.

Using this command the following directories and contents will be added to your project:


The templates within the "scaffolding" directory are where you want to make your changes/enhancements.

So, in short, no, there is no out of the box functionality for this, but you can add it on your own.

contestado el 28 de mayo de 14 a las 13:05

Thank you for your fast reply. Is there any Grails Plugin that can solve that problem? - Eddy2Go

Nope, but you could author one! (: - Joshua Moore

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.