Plugins You can find out about all the publicly available Grails plugins.

Likeable Plugin

  • Tags: like, rateable
  • Latest: 0.4.0
  • Last Updated: 03 October 2015
  • Grails version: 2.3 > *
0 vote
compile "org.grails.plugins:likeable:0.4.0"

 Documentation  Source  Issues


Adds like functionality to domain classes. A light version of Rateable plugin


compile ':likeable:0.1.2'


To use the plugin, you should define user evaluator and user's Class in grails-app/conf/Config.groovy:
grails.plugin.likeable.liker.evaluator = { request.user }
grails.plugin.likeable.liker.className = ''
To add like functionality to domain type, you should implement the Likeable interface:
import ru.jconsulting.likeable.Likeable
class Post implements Likeable {
After implementing marker interface domain's metaClass will gain likeable methods:
  • like(user) - adds a like by provided user, or remove existing
  • userLike(user) - returns Like instance if user liked the Likeable, or null otherwise
  • userLiked(user) - returns true if user liked the Likeable, or false otherwise
  • getTotalLikes() - returns likes count for the Likeable