0

I need the scaffold functionality. For that instead of doing create-controller and manually adding the

def scaffold = true

to each controller, I installed templates and added

def scaffold = true

inside src/templates/artifacts/Controller.groovy file as below.

@artifact.package@class @artifact.name@ {
    def scaffold = true

}

The interesting fact is create-* only works for this case.

Question: Instead of create-controller class_name one by one, is there a way to create-controller * functionality like generate-controller *?

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
Bhuwan Gautam
  • 1,229
  • 1
  • 11
  • 24
  • 2
    You should use `create-scaffold-controller`. If you add that line to your regular controller template, all controllers will be scaffolded by default. Using a wildcard ("uber-generate") was something that was added for the generate scripts, but I assume not for the `create-controller` and `create-scaffold-controller` scripts because they generate such trivial classes, it's easy enough to just create them by hand. – Burt Beckwith Jan 15 '15 at 13:50
  • Burt which file you are referring to? if it the same i have mentioned above then it will not work. This template only be used in case of create-controller command. – Bhuwan Gautam Jan 15 '15 at 14:23
  • 1
    `create-controller` is for non-scaffolded controllers where you define all of the actions and it's created from the `templates/artifacts/Controller.groovy` template. If you want a scaffolded controller, use `create-scaffold-controller` which creates a controller using `templates/artifacts/ScaffoldingController.groovy`. – Burt Beckwith Jan 15 '15 at 14:59

0 Answers0