Last updated by 5 years ago

Page: Taggable Plugin, Version:2

Taggable Plugin

This plugin provides an alternative to the Acts as Taggable hosted at and with the following features.

  • Classes can be made taggable by implementing the org.grails.taggable.Taggable interface
  • Method chaining can be used to add tags
  • The table name the domain classes use is customizable
  • Utilizes extensive caching to improve performance
  • Property use of packages to avoid domain conflicts


Grails Version: 1.1 and above JDK: 1.5 and above


grails install-plugin taggable


Implement the Taggable interface:

import org.grails.taggable.*

class Vehicle implements Taggable { }

Add some tags:

def v = Vehicle.get(1)

v.addTag("red") .addTag("sporty") .addTag("expensive")


def v = Vehicle.get(1)
println v.tags

def vehicles = Vehicle.findAllByTag("sporty") def count = Vehicle.countByTag("sporty")

Customized Table names in Config.groovy: