Created
October 22, 2010 14:29
-
-
Save frekw/640630 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone.sync.parsers({ | |
MyDocumentsModel: { | |
url: "/documents", | |
parse: function(response){ | |
return response.documents; | |
} | |
}, | |
... | |
}); | |
// actually, this would probably be a better idea so we don't get such a high level of cohesion between names and strings... | |
Backbone.sync.parsers[MyDocumentsModel] = { | |
url: "/documents", | |
parse: function(response){ return response.documents; } | |
} | |
Backbone.sync.parsers[MyTags] = { | |
url: "/documents", | |
parse: function(response){ return _.map(response.documents, function(d){ return d.tags }); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment