-
-
Save sebastibe/5279233 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
User = Backbone.Model.extend({ | |
url: function() { | |
var origUrl = Backbone.Model.prototype.url.call(this); | |
return origUrl += origUrl.endsWith('/') ? '' : '/'; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use the
endsWith
string method, you need the following code: