////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////


== scaffolding



=== Purpose


The `scaffolding` plugin configures Grails' support for CRUD via link:{guidePath}scaffolding.html[scaffolding].


=== Examples


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

[source,groovy]
----
import grails.plugin.scaffolding.annotation.Scaffold

@Scaffold(Book)
class BookController {
}
----

You can also scaffold services:

[source,groovy]
----
import grails.plugin.scaffolding.annotation.Scaffold

@Scaffold(Book)
class BookService {
}
----

For controllers that delegate to a service layer:

[source,groovy]
----
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:

[source,groovy]
----
class BookController {
   static scaffold = Book   // Legacy syntax - @Scaffold annotation is preferred
}
----

NOTE: The `static scaffold = true` form is not supported in Grails 3.0 and above.


=== Description


Refer to the section on link:{guidePath}scaffolding.html[scaffolding] in the Grails user guide which details Grails' scaffolding support.
