generate-views

Purpose

Examples

Description

Grails supports a feature known as static scaffolding which involves the generation of a CRUD (Create/Read/Update/Delete) interface for a given domain class. Once generated, the controller and its views can be modified by you but they won't automatically update when you change the domain class.

The generate-views command generates just the GSP views that implement CRUD for the given domain class. The argument is optional, but if you don't include it the command will ask you for the name of the domain class to scaffold. So for a domain class org.bookstore.Book, the command will generate the appropriate 'list', 'show', 'create' and 'edit' views in grails-app/views/book.

Usage:

grails generate-views [domain class name]

Fired Events:

StatusUpdate - When generation begins

StatusFinal - When generation completes

Arguments:

domain class name - Either a domain class name (case-sensitive) or a wildcard (*). If you specify the wildcard then views will be generated for all domain classes.

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
Sponsored by SpringSource