The static methods findAll, findOne, create, update and destroy return a Deferred. If you look at their corresponding documentation, you'll see how to implement your own using a function.
The simplest way to implement them is using a string that is the URL that will be used in the Ajax call. Any parameters you pass in to each call will be passed along to your backend service.
So if findAll is defined as '/recipes'
Then this call:
- Cookbook.Models.Recipe.findAll({order: 'name ASC'})
Would result in an Ajax call like this:
- $.ajax({
- url: '/recipes',
- type: 'get'
- data: 'order=name ASC'
- })