I'm attempting to build out a simple TODO plugin using Backbone and have run into an issue with the AJAX API. In order to get the correct AJAX call back you have to pass in the "action" parameter like this:
which works fine for the GET method in Backbone. However, when using DELETE Backbone will use a URL like this by default:
where "9" is the ID of the todo being deleted. By adding on this ID it breaks the AJAX call on the WordPress side. I can manually override the URLs for each of the methods but I'd like to know if there's a more elegant way to get the AJAX API to work with Backbone.
I've created a demo plugin which shows the specific issue I've run in to. Load the settings page and click on any of the X's while watching your Network inspector to see the 0 value AJAX results coming from WordPress.