O'Reilly logo

Grails 2: A Quick-Start Guide by Ben Klein, Dave Klein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding the Dashboard Action

We can tell from looking at the code for our dashboard view that it will need the following data elements when it is rendered: event, tasks, volunteers, messages, and sponsorships. The first of these is a single TekEvent instance; the rest are collections of related objects.

Some of these collections need to be filtered or limited in some way. This will also be done in the controller action.

Let’s see how easy this can be. Open TekDays/grails-app/controllers/com/tekdays/DashboardController.groovy. The empty index action should already be there. Right after that, add the dashboard action:

bigger.2/TekDays/grails-app/controllers/com/tekdays/DashboardController.groovy
 
package​ com.tekdays
 
class​ DashboardController ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required