Skip to content

Instantly share code, notes, and snippets.

@ascot21
Created July 5, 2013 21:33
Show Gist options
  • Save ascot21/5937401 to your computer and use it in GitHub Desktop.
Save ascot21/5937401 to your computer and use it in GitHub Desktop.
Override Backbone.sync method on individual model
sync: (method,model,options) ->
if method is "create"
options.beforeSend = (xhr) ->
xhr.setRequestHeader 'X-HTTP-Method-Override', 'PUT'
Backbone.sync(method,model,options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment