Skip to content

Instantly share code, notes, and snippets.

@davidpett
Created February 1, 2013 18:35
Show Gist options
  • Save davidpett/4693153 to your computer and use it in GitHub Desktop.
Save davidpett/4693153 to your computer and use it in GitHub Desktop.
DS.SCAdapter = DS.RESTAdapter.extend({
serializer: DS.SCSerializer,
ajax: function(url, type, hash) {
hash.url = url;
hash.type = type;
hash.dataType = 'json';
hash.contentType = 'application/json; charset=utf-8';
hash.context = this;
if (this.clientId !== '') {
hash.url += '.js?client_id=' + this.clientId;
}
if (hash.data && type !== 'GET') {
hash.data = JSON.stringify(hash.data);
}
jQuery.ajax(hash);
},
clientId: ''
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment