Someone
public text v1 · immutabledef save = {
def teamInstance = new Team(params)
if (teamInstance.save(flush: true)) {
flash.message = "${message(code:'default.created.message', args: [message(code: 'team.label', default: 'Team'), teamInstance.id])}"
params.members.each { new Membership(team: teamInstance, member: it).save(failOnError: true) }
redirect(action: "show", id: teamInstance.id)
}
else {
render(view: "create", model: [teamInstance: teamInstance])
}
}