Include Plugin

Summary

Description

Include Plugin

The Include plugin provides include behaviour to Grails using a taglib.

This behaviour provides better DRY on controllers, using g:render tag in Grails you should pass model/collection/bean to a template, with this plugin you can insert other actions or static files on a web page.

Installation

To install the include plugin run the following command

grails install-plugin include

Usage

This plugin provides one tag, to include urls(to actions or static resources) or controllers/actions.

The called controllers wouldn't change any line of code, the changes should be at views and templates only.

include tag

With 0.3 version you need only this tag, includeUrl and includeController were deprecated.

With url attribute is possible include urls mapped to actions, views and static resources(on web-app directory).

<inc:include url="/user/list"/>

or

<inc:include url="/resource.html"/>

The controller attribute is the recommended way to include actions, because is less likely to change a controller or an action name than an url. The optional attributes are action and params, without action is called index action by convention.