Variables available in grails templates

后端 未结 1 444
陌清茗
陌清茗 2020-12-20 05:40

I am trying to edit grails scaffolding template to create individual fields in create.gsp and edit.gsp

If I add following in create.gsp

<%
                


        
1条回答
  •  一生所求
    2020-12-20 06:26

    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:

    1. Create your own scaffolding task using create-command as explained in link given above.
    2. Use the scaffolding plugin and extend FormFieldsTagLib to define a custom behaviour for tag.

    0 讨论(0)
提交回复
热议问题