Spawn - Template Plugin

  • Authors : null
0 vote
Dependency :
compile ":spawn:0.4"




Go to your project root and run the command:

grails install-plugin spawn

You'll probably want to base your templates around the default Grails templates. They're a good starting point. In order to get them, run:

grails install-templates

The default templates will then be placed in src > templates > scaffolding


Spawn plugin allows you to specify a specific template for a domain class. This way you can have multiple templates within your application and assign them to whichever domain class you would like to use them with. You simply add a folder containing the templates to src > templates > scaffolding > templateName. Then you add the line 'static templateName = "templateName";' to your domain class. Then you would use the command 'grais spawn-all domainClass (+)' to generate the contoller and views as you would with the default generaiton scripts.