(Quick Reference)
generate-controller
Purpose
The
create-controller
command generates a controller and associated unit test for the given domain class
Examples
grails generate-controller org.bookstore.Book
Description
Grails supports a feature known as scaffolding which involves the generation of a CRUD (Create/Read/Update/Delete) interface for a given domain class.
The
generate-controller
command generates a controller that implements CRUD for the given domain class. So for a domain class
org.bookstore.Book
a controller
BookController.groovy
in
grails-app/controllers/org/bookstore
will be generated.
Usage:
grails generate-controller [domain class name]
Fired Events:
StatusUpdate
- When generation begins
StatusFinal
- When generation completes