I have a list of Team objects that have an Integer seed property. I want to edit all the teams\' seeds at once, in a single form. I\'m sure
params is more than a regular Map, it's a GrailsParameterMap that automatically builds up sub-Map structures based on splitting the parameter names by '.'. You might take advantage of this by using the following gsp:
NB: there's no [] in the name attributes. The controller is now pretty simple using some black Grails magic :
log.error "params = ${params}"
params.teams.findAll {k,v -> !k.contains(".")}.each { k,v ->
bindData(Team.get(v.id), v)
}
The first operation findAll filters out all parameters with a dot inside. The rest is a map of maps holding the row id in k and the id and seed in v.
I hope this answers your question.