mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Use getValue to interpret urlRoot instead.
This commit is contained in:
@@ -292,8 +292,7 @@
|
||||
// using Backbone's restful methods, override this to change the endpoint
|
||||
// that will be called.
|
||||
url : function() {
|
||||
var base = getValue(this.collection, 'url') || this.urlRoot || urlError();
|
||||
if (typeof(base) == 'function') base = base.call(this); // allow urlRoot to be determined at runtime
|
||||
var base = getValue(this.collection, 'url') || getValue(this, 'urlRoot') || urlError();
|
||||
if (this.isNew()) return base;
|
||||
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user