Creating a New Controller
Now that we’re all warmed up and ready, we’ll get to work on the new organizer’s dashboard view. To keep our overall architecture clean and not confuse the conventions that have proved so helpful to us, we will create a new controller for the dashboard view and any related views. We’ll use the create-controller script to do this:
| | $ grails create-controller com.tekdays.Dashboard |
The script creates the file TekDays/grails-app/controllers/com/tekdays/DashboardController.groovy, along with the corresponding test file TekDays/test/unit/com/tekdays/DashboardControllerSpec.groovy. It also creates the TekDays/grails-app/views/dashboard directory, where our new controller will look for views.
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