Skip to content

Instantly share code, notes, and snippets.

@geraldodev
Created June 2, 2012 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geraldodev/2860310 to your computer and use it in GitHub Desktop.
Save geraldodev/2860310 to your computer and use it in GitHub Desktop.
219c219,220
< 'save': {method:'POST'},
---
> 'create': {method:'POST'},
> 'update': {method:'PUT'},
421a423,431
>
> Resource.prototype.$save = function(a1, a2, a3) {
> if (this.id) {
> Resource.prototype.$update.call(this, a1, a2, a3);
> } else {
> Resource.prototype.$create.call(this, a1, a2, a3);
> }
> }
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment