Skip to content

Commit

Permalink
Allow root resources to have nested resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
allanca committed Sep 6, 2011
1 parent 46887b8 commit a77b949
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ Resource.prototype.add = function(resource){
, route;

// relative base
resource.base = this.base + this.name + '/' + this.param + '/';
resource.base = this.base + (this.name ? this.name + '/': '') +
this.param + '/';

// re-define previous actions
for (var method in resource.routes) {
Expand Down

0 comments on commit a77b949

Please sign in to comment.