Skip to content

Instantly share code, notes, and snippets.

@iamnoah
Created July 24, 2010 23:02
Show Gist options
  • Select an option

  • Save iamnoah/489065 to your computer and use it in GitHub Desktop.

Select an option

Save iamnoah/489065 to your computer and use it in GitHub Desktop.
import groovy.xml.MarkupBuilder;
class FrameworkTagLib {
static namespace = "ajax"
def include = { attrs ->
def controller = attrs.controller, action = attrs.action, id = attrs.id
def component = "${controller}-${action}" + (id ? "-${id}" : "")
out << """<div id="${component}" class="ajax-component">"""
out << g.include(attrs)
out << "</div>"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment