简体   繁体   中英

the CRUD methods not created in grails 2.3.4 controller

In Grails 2.3.4 , in creating the controller why it does not create the CURD methods ,although i put in the domain :

 static scaffold = true

the contoller only got 1 method called :

index

I'm wondering where are the rest of the methods show , create , ...etc

When you use static scaffold = true you're using dynamic scaffolding. This means that the controller and GSPs are created in-memory for you. When you use the generate-* scripts, eg generate-all , generate-controller , and generate-views you're using static scaffolding. These scripts create real files that you can edit. But if you don't edit anything, the net result is the same.

Dynamic scaffolding is good for getting started, for demos, and sometimes for simple admin UIs. But you'll find static scaffolding is better in general since the generated code (either dynamic in-memory or static) is only a decent starting point and you'll need to do some customization.

This is described in the docs: http://grails.org/doc/latest/guide/scaffolding.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM