(Quick Reference)

scaffolding

Purpose

The scaffolding plugin configures Grails' support for CRUD via scaffolding.

Examples

An example of enabling "dynamic" scaffolding using the @Scaffold annotation:

import grails.plugin.scaffolding.annotation.Scaffold

@Scaffold(Book)
class BookController {
}

You can also scaffold services:

import grails.plugin.scaffolding.annotation.Scaffold

@Scaffold(Book)
class BookService {
}

For controllers that delegate to a service layer:

import grails.plugin.scaffolding.annotation.Scaffold
import grails.plugin.scaffolding.RestfulServiceController

@Scaffold(RestfulServiceController<Book>)
class BookController {
}

The legacy static scaffold syntax is still supported but the @Scaffold annotation is preferred:

class BookController {
   static scaffold = Book   // Legacy syntax - @Scaffold annotation is preferred
}
The static scaffold = true form is not supported in Grails 3.0 and above.

Description

Refer to the section on scaffolding in the Grails user guide which details Grails' scaffolding support.