Chapter 1. Grails in a hurry...
Listing 1.1. Our first quote controller
Listing 1.2. Adding some output
Listing 1.3. Handling redirects
Listing 1.4. A random quote action
Listing 1.5. Implementing our first view
Listing 1.6. Updating the view
Listing 1.7. Adding a layout
Listing 1.8. Our first domain class with teeth
Listing 1.9. Data source definition—in memory
Listing 1.10. Data source definition—persistent
Listing 1.11. Random refactored
Listing 1.12. A database-driven random
Listing 1.13. Enabling scaffolding
Listing 1.14. Adding basic validation
Listing 1.15. Beefing up our service
Listing 1.16. Invoking our service
Listing 1.17. Our first test case
Listing 1.18. Adding real tests
Listing 1.19. Test output
Listing 1.20. Adding a JavaScript library for Ajax
Listing 1.21. Invoking Ajax functionality
Listing 1.22. The server side of Ajax
Listing 1.23. Crunching numbers: the grails stats command in action
Chapter 2. The Groovy essentials
Listing 2.1. Initializing lists and maps in Groovy
Listing 2.2. Accessing list and map elements
Listing 2.3. Ranges
Listing 2.4. Valid and invalid line breaks
Listing 2.5. Regular expression capture groups
Listing 2.6. Closure assigned to a variable
Listing 2.7. Playing with XML the Groovy way
Chapter 3. Modeling the domain
Listing 3.1. Our first basic User object
Listing 3.2. Saving and retrieving a domain object from the database
Listing 3.3. Updating users by changing field values and calling save()