Created
April 8, 2012 19:25
-
-
Save MichaelAstreiko/2339446 to your computer and use it in GitHub Desktop.
Process API call in Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list = { | |
def domainNameInPluralForm = params.domainInPlural | |
def domainName = retrieveDomainName(domainNameInPluralForm) | |
def entity = grailsApplication.getArtefacts("Domain").find { | |
it.getShortName() == domainName | |
}?.clazz | |
def result = entity.list(params) | |
def converter = [domainNameInPluralForm:result] as JSON | |
render text: converter.toString(), contentType: 'application/json' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment