You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: grails-doc/src/en/guide/upgrading/upgrading60x.adoc
+145-1Lines changed: 145 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1238,4 +1238,148 @@ The admin controller will use the admin-specific template even if a non-namespac
1238
1238
1239
1239
====== Backward Compatibility
1240
1240
1241
-
This feature is **disabled by default** (`false`), ensuring complete backward compatibility. Existing applications will continue to work without any changes. Enable the feature only when you need namespace-specific scaffolded template support.
1241
+
This feature is **disabled by default** (`false`), ensuring complete backward compatibility. Existing applications will continue to work without any changes. Enable the feature only when you need namespace-specific scaffolded template support.
1242
+
1243
+
===== 12.31 Enhanced Display Constraint with DisplayType Enum
1244
+
1245
+
Grails 7.1 enhances the `display` constraint with a new `DisplayType` enum that provides fine-grained control over where properties appear in scaffolded views.
1246
+
1247
+
====== New DisplayType Values
1248
+
1249
+
The `display` constraint now accepts a `DisplayType` enum value in addition to boolean values:
1250
+
1251
+
|===
1252
+
|Value|Description
1253
+
1254
+
|`ALL`|Display in all views. Overrides the default blacklist for properties like `dateCreated` and `lastUpdated`.
1255
+
|`NONE`|Never display in any view. Equivalent to `display: false`.
1256
+
|`INPUT_ONLY`|Display only in input views (create and edit forms).
1257
+
|`OUTPUT_ONLY`|Display only in output views (show and index/list views).
Starting in Grails 7.1, the `@Scaffold` annotation is the preferred approach for enabling scaffolding on controllers and services. While the legacy `static scaffold = Domain` syntax is still supported, the annotation provides additional features and flexibility.
1294
+
1295
+
====== Benefits of @Scaffold
1296
+
1297
+
* **Supports both controllers and services** - The annotation works on both artefact types
1298
+
* **Custom class extension** - Specify a custom class to extend using the generic syntax
1299
+
* **Service-backed controllers** - Create controllers that delegate to a service layer for better separation of concerns
1300
+
* **Read-only mode** - Built-in support for read-only scaffolding
New CLI commands are available to generate scaffolded controllers and services:
1370
+
1371
+
[source,bash]
1372
+
----
1373
+
# Generate a scaffolded controller
1374
+
grails create-scaffold-controller Book
1375
+
1376
+
# Generate a scaffolded service
1377
+
grails create-scaffold-service Book
1378
+
1379
+
# Generate both service and controller
1380
+
grails generate-scaffold-all Book
1381
+
----
1382
+
1383
+
These commands support options like `--extends` to specify a custom class to extend, `--namespace` for controller namespacing, and `--service` to use `RestfulServiceController`.
1384
+
1385
+
For full details, see the link:{guidePath}scaffolding.html[Scaffolding] documentation.
0 commit comments