5

我要修改的主要模板是工件。任何人都知道如何创建工件模板?

另外,它只在脚手架目录下安装了这三个文件:AsyncController.groovy、AsyncSpec.groovy、ScaffoldedController.groovy。

4

1 回答 1

2

其实是install-template命令有问题。在 Grails 3.1 版中,它不会按预期创建带有视图页面 (gsp) 的工件目录。

您只需要创建一个工件目录并将您的自定义视图页面放入其中:

/$YOUR_GRAIL_APP_DIR/src/main/templates/artifacts/scaffolding/create.gsp
/$YOUR_GRAIL_APP_DIR/src/main/templates/artifacts/scaffolding/edit.gsp
/$YOUR_GRAIL_APP_DIR/src/main/templates/artifacts/scaffolding/index.gsp
/$YOUR_GRAIL_APP_DIR/src/main/templates/artifacts/scaffolding/show.gsp

问候,

——西尔维奥

于 2016-02-04T15:38:46.150 回答