 
   onSaveSuccess: ->
   onSaveError: ->
-  onDeleteSuccess: ->
-  onDeleteError: ->
+  onDestroySuccess: ->
+  onDestroyError: ->
 
 
 

    # use that more familiar syntax, they'll blow away events
    # defined in this class.
    @$el.delegate('.save-button',   'click', _.bind(@save, @))
    @$el.delegate('.delete-button', 'click', _.bind(@delete, @))
    @$el.delegate('.cancel-button', 'click', _.bind(@cancelEdit, @))

    # Begin editing when this resource is clicked

          attrs[name] = value
    attrs

  destroy: (e)->
    e?.preventDefault()
    @confirmDestroy @resource, =>
      @$el.removeClass('neat-editable').addClass('deleted')

      @model.destroy
        wait: true
        success: => @onDestroySuccess
        error: _.bind(@onSaveError, @)
      @cancelEdit()

  confirmDestroy: (resource, callback)->
    if confirm("Delete this #{resource}?")
      callback()

