encodeURIComponent this.id

in Backbone.Model.prototype.url
This commit is contained in:
Johannes J. Schmidt
2011-01-31 17:10:50 +01:00
committed by Jeremy Ashkenas
parent c6d2c69d82
commit aab49ebded

View File

@@ -307,7 +307,7 @@
url : function() {
var base = getUrl(this.collection) || this.urlRoot || urlError();
if (this.isNew()) return base;
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + this.id;
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
},
// **parse** converts a response into the hash of attributes to be `set` on