def delete = {
def country = Country.get(params.id)
if (country) {
try {
country.delete(flush: true)
flash.message = "Country ${params.id} deleted"
redirect(action: list)
}
catch (org.hibernate.exception.ConstraintViolationException e) {
flash.message = "Country ${params.id} not deleted"
redirect(action: show, id: params.id)
}
}
else {
flash.message = "Country not found with id ${params.id}"
redirect(action: list)
}
}