views:

48

answers:

2

Hello,

I'm creating a DB web application with grails for my company and found myself in the need to change the default scaffolding templates.

So far so good, everything gets generated with the modified templates (controllers, views, ..).

Now, however, I get a request to create some "composite screens" with functionalities and a layout that differ from the overwritten templates.

So now my question is: is it possible in grails to create one or more templates (next the the default one) and pass this template name as an argument to the generate-* commands?

Thanks in advance!

EDIT: Adding the template name to the generate commands was just an idea, if it's possible to do this a different way, I'll be happy too.

+1  A: 
amra
Will probably extend/overwrite this class / script.I'll get back to you on this.
Molske
I had some trouble with overriding these classes/scripts, but eventually this is starting to work. Thanks for the response.
Molske
+1  A: 

I am not sure about the generate command parameters, but if you add another .gsp page into scaffolding directory, I believe it will try to run it through generation process.

So for example I used to have a show.gsp page as well as showBasic.gsp page, which showed fewer properties.

Jean Barmash
it's true that this works, but i also have to override the controller, if I don't, the controller logic won't match the views anymore.
Molske