Generating Scaffolding Code
Grails gives us an easy way to generate the code that does what the dynamic scaffolding has been doing for us. We won’t see any changes to the application, but we will have the code necessary to make changes. To get started, we will use the grails generate-all script.
The generate-all script can be called in a few different ways. If you call it with no arguments, you will be prompted for a name. (By convention, this would be a domain class name.) For the more argumentative types, you can call generate-all with a name as the argument. Both of these approaches generate a controller, four .gsp view files, and a template, which is also a .gsp file. (We’ll have a detailed discussion on templates in Of Templates and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access