Created
October 14, 2013 15:54
-
-
Save pabloalba/6977872 to your computer and use it in GitHub Desktop.
Get a list of ids, and show the elements. This code is too damn long for this simple task. Improvements?
This file contains 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 showContents(){ | |
def contents = [] | |
def ids = params.list('id').findAll { it.isLong() }*.toLong() | |
if (ids) { | |
contents = Content.createCriteria().list { | |
'in' 'id', ids | |
} | |
} | |
render view:'showContents', model:[contents:contents] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Si no funciona el metodo "getAll" puedes usar "findAllByIdInList" que debería comportarse igual