Grails - wyświetl wiadomość flash

Jestem nowy w Grails i mam pytanie, które powinno być łatwe dla większości z was.

Mam stronę wyświetlającąobject lista. Chcę wyświetlić wiadomość, jeśli jestDataIntegrityViolation kiedyobject jest usunięty. To co robię to:

def delete() {

    def instanceToDelete= Myobject.get(params.id)
    try {
        instanceToDelete.delete(flush: true)
        redirect(action: "list", id: params.id)
    }
    catch (DataIntegrityViolationException e) {
        flash.message = "some message"
        //I want to refresh the div containing the flash.message here
    }
}

Tutaj powinna być wyświetlana wiadomość flash:

  <g:if test="${flash.message}">
  <div class="alert alert-error" style="display: block">${flash.message}</div>

Przepraszam - wiem, że to głupie pytanie, ale naprawdę nie mogę znaleźć rozwiązania.

questionAnswers(3)

yourAnswerToTheQuestion