Created
February 22, 2012 17:25
-
-
Save dericcrago/1886177 to your computer and use it in GitHub Desktop.
add trailing slash to Backbone.Model urls
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
// example | |
User = Backbone.Model.extend({ | |
url: function() { | |
var origUrl = Backbone.Model.prototype.url.call(this); | |
return origUrl + (origUrl.charAt(origUrl.length - 1) == '/' ? '' : '/'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a version, that handles GET params in correct way