Skip to content

Commit

Permalink
merge mkelley's urlBase, renamed to urlRoot.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Dec 10, 2010
1 parent 03aa12a commit e8be47f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backbone.js
Expand Up @@ -291,7 +291,7 @@
// using Backbone's restful methods, override this to change the endpoint
// that will be called.
url : function() {
var base = this.urlBase || getUrl(this.collection);
var base = this.urlRoot || getUrl(this.collection);
if (this.isNew()) return base;
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + this.id;
},
Expand Down
6 changes: 3 additions & 3 deletions test/model.js
Expand Up @@ -65,10 +65,10 @@ $(document).ready(function() {
equals(failed, true);
doc.collection = collection;
});
test("Model: url when using urlBase", function() {

test("Model: url when using urlRoot", function() {
var Model = Backbone.Model.extend({
urlBase: '/collection'
urlRoot: '/collection'
});
var model = new Model();
equals(model.url(), '/collection');
Expand Down

0 comments on commit e8be47f

Please sign in to comment.