Skip to content

Instantly share code, notes, and snippets.

@Peleg
Created August 18, 2014 22:28
Show Gist options
  • Save Peleg/a7135b4a254da9a07e0d to your computer and use it in GitHub Desktop.
Save Peleg/a7135b4a254da9a07e0d to your computer and use it in GitHub Desktop.
// load this in admin.js
Tenement.Model = Backbone.Model.extend({
url: function () {
return '/admin/api' + this.urlRoot;
}
});
// load this one in application.js
Tenement.Model = Backbone.Model.extend({
url: function () {
return '/app/api' + this.urlRoot;
}
});
// Tenement.Model will be different file
Tenement.Models.Room = Tenement.Model.extend({
paramRoot: 'room',
urlRoot: '/rooms',
toString: function() {
return this.get('name');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment