With scaffolding
plugin in grails 3.x, it's not possible to do what you are trying to achieve. While generating templates for domains, scaffolding plugin doesn't load any of the domain class or you can say it doesn't load the grails application.
Scaffolding plugin uses scripts generated by create-script
to generate templates.
In Grails 3.x it is not possible to load a Grails application within a
code generation script created by the create-script
command.
For more info, read this link.
So you have two options:
- Create your own scaffolding task using
create-command
as explained in link given above.
- Use the scaffolding plugin and extend
FormFieldsTagLib
to define a custom behaviour for <f:all bean=""/>
tag.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…