(Quick Reference)

generate-controller

Description

Generates a Controller that performs REST operations.

Synonyms

generate-resource-controller

Arguments

Name

Description

Required

Domain Class

The name of the Domain Class

true

Flags

Name

Description

Type

force

Whether to overwrite existing files

boolean, default: false

Usage

$ grace generate-controller [Domain Class]

Examples

$ grace generate-controller Post
| Rendered template Controller.groovy to destination app/controllers/com/example/PostController.groovy
| Rendered template Service.groovy to destination app/services/com/example/PostService.groovy
| Rendered template Spec.groovy to destination src/test/groovy/com/example/PostControllerSpec.groovy
| Rendered template ServiceSpec.groovy to destination src/integration-test/groovy/com/example/PostServiceSpec.groovy
| Scaffolding completed for app/domain/com/example/Post.groovy