8.6.1.2 Updating Content 2.4.4

See the light - agile, industrial strength, rapid web application development made easy

(Quick Reference) # 8.6.1.2 Updating Content - Reference Documentation Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari Version: 2.4.4 ## 8.6.1.2 Updating Content This is great, but usually you provide feedback to the user about what happened:
    def delete() {
        def b = Book.get(params.id)
        b.delete()
        render "Book ${b.id} was deleted"
    }
GSP code:
    <div id="message"></div>
    <g:remoteLink action="delete" id="1" update="message">
    Delete Book
    </g:remoteLink>
The above example will call the action and set the contents of the `message` `div` to the response in this case `"Book 1 was deleted"`. This is done by the `update` attribute on the tag, which can also take a Map to indicate what should be updated on failure:
    <div id="message"></div>
    <div id="error"></div>
    <g:remoteLink update="[success: 'message', failure: 'error']"
                  action="delete" id="1">
    Delete Book
    </g:remoteLink>
Here the `error` div will be updated if the request failed. | Quick Reference (hide)