Using Phil Sturgeon's Codeigniter REST SERVER, I've set up a basic REST server to interact with a Backbone application. The issue is that whenever the applcation tries to make a DELETE request to the proper URI (for instance, api/object/7 where 7 is the ID number in question), REST returns a 404 Not Found error. A bit of digging revealed that it was trying to reach the nonexistint 7_delete within the controller instead of calling index_delete as it should.
I've checked the requests, and they're routing to the correct URL; I've also checked that there are no custom routes set up which would interfere and there are none. Suggestions?
EDIT: For more detail, the Backbone routing is set up like this:
urlRoot: 'api/objective/',
The Objective controller in CI meanwhile is set up like this:
class Objective extends REST_Controller {
/**
* Respond to a POST request;
* - If given an ID, update an existing record
* - If given no ID, create a new record
*/
public function index_post() {
// code here...
}
/**
* Delete an existing record from a passed URL
*/
public function index_delete($id) {
// Code here...
}
/**
* Get a single record
*/
public function index_get($id) {
// Code here...
}
/**
* Get the full objectives list
*/
public function index_get() {
// Code here...
}
}
This is close to the example provided in the original example file. The CI routing has nothing set up however.