Domanda

I'm still pretty new to Backbone and I've been trying to find an answer to this for a bit:

So, I know for the first 3 types of CRUD requests (Create, Read and Update) that you have the server return the JSON for a model. What I wanted to know is do you do the same for Delete?

È stato utile?

Soluzione

You DO need to respond with JSON. A common practice is just to return a simple JSON object with a message. (It doesn't need to be the data for the model destroyed). Consider responding with:

{ message: "Model successfully destroyed!" }

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top