Skip to content

Instantly share code, notes, and snippets.

@spinscale
Created February 5, 2013 10:41
Show Gist options
  • Save spinscale/4713650 to your computer and use it in GitHub Desktop.
Save spinscale/4713650 to your computer and use it in GitHub Desktop.
static JadeConfiguration config = new JadeConfiguration()
static {
config.setTemplateLoader(new FileTemplateLoader("src/main/resources/views/", "UTF-8"))
}
def json(Object obj) {
return JSON.default.toJSON(obj)
}
def jade(String template, Object obj) {
JadeTemplate jadeTemplate = config.getTemplate(template)
return config.renderTemplate(jadeTemplate, obj)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment