Answer the question
In order to leave comments, you need to log in
How to send information via backbone.js destroy method to server?
It turns out to delete data from the database, but I want to send the value along with the deletion - the method of deletion (the user chooses it himself).
Delete "folder" with all entries or moving entries to another.
Actually, I would like to pass this parameter.
Answer the question
In order to leave comments, you need to log in
Found the solution :)
The object what you pass as a parameter to destroy will eventually end up as the settings parameter to a jQuery.ajax call.
So if you need to send additional data you need to use the data proeprty:
var thisDeal = new WhiteDeals.Models.EditorDeal({ id: dealID });
thisDeal.destroy({data: { program_id: dealProgram.id }, processData: true})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question