Skip to content

Instantly share code, notes, and snippets.

@iamnoah
Created July 23, 2010 22:27
Show Gist options
  • Save iamnoah/488142 to your computer and use it in GitHub Desktop.
Save iamnoah/488142 to your computer and use it in GitHub Desktop.
def list = {
[:]
}
def renderList = {
params.max = Math.min(params.max ? params.int('max') : 10, 100)
[productIds: Product.list(params)*.id, productInstanceTotal: Product.count()]
}
def renderProduct = {
[productInstance: Product.get(params.id),productImage: (params.list('color')[0]?:'white')+".png",
colors:['yellow','red','green','blue']]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment