This is an automated email from the ASF dual-hosted git repository.
matrei pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to refs/heads/7.0.x by this push:
new 18dc25ea7e Issue-15061 Grails-doc bug in render example (#15072)
18dc25ea7e is described below
commit 18dc25ea7e4d5b64a551d01dd436eeaa6ba2799d
Author: Thomas Rasmussen <[email protected]>
AuthorDate: Tue Sep 16 14:20:58 2025 +0200
Issue-15061 Grails-doc bug in render example (#15072)
The code example in the documentation did not work.
---
grails-doc/src/en/ref/Controllers/render.adoc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/grails-doc/src/en/ref/Controllers/render.adoc
b/grails-doc/src/en/ref/Controllers/render.adoc
index 65e4273772..cc2a234718 100644
--- a/grails-doc/src/en/ref/Controllers/render.adoc
+++ b/grails-doc/src/en/ref/Controllers/render.adoc
@@ -63,9 +63,13 @@ render {
}
// render some XML markup to the response
+def bookList = [
+ new Book(title: 'The Shining', author: 'Stephen King'),
+ new Book(title: 'The Great Gatsby', author: 'F. Scott Fitzgerald')
+]
render(contentType: "text/xml") {
books {
- for (b in books) {
+ for (b in bookList) {
book(title: b.title, author: b.author)
}
}