derickbailey/backbone.marionette — Issue #25: model.destroy() fires DELETE events to backend twice
Author: simax
Created: 2012-02-16 14:32:28+00:00
State: open

I have very simple backbone model and collection. I have a corresponding backbone.marionette.CollectionView and backbone.marionette.ItemView and they live in a backbone.marionette.region.

The ItemView template contains a "remove" button. The click event of the remove button issues a model.destroy(). A HTTP DELETE is sent to the backend, buts it appears to be issued twice and because the second time it fails, the item is not removed from the collection.

Everything else is working fine, just the HTTP DELETE being issued twice. Any idea why?

I'm using version v0.4.5

The code is CoffeeScript, hope thats ok.

```
# Model:
class User extends Backbone.Model
idAttribute: "_id"

# Collection
class Users extends Backbone.Collection
model: app.User
url: "/someUrl/Users"

# CollectionView
class UserListView extends Backbone.Marionette.CollectionView
tagName: "ul",
itemView: app.UserItemView

# ItemView
class UserItemView extends Backbone.Marionette.ItemView
template: "#item"
tagName: "li"

events:
"click .edit": "edit"
"click .remove": "remove"

remove: ->
@model.destroy()

edit: (e) ->
alert JSON.stringify @model

```