Permalink
Browse files

Only replace last :collection_id when collection: true set

  • Loading branch information...
1 parent 1ddd479 commit 390a1fd312d2e8168cdd09a8e329069f79abf0bd @1602 committed Feb 13, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/railway_routes.js
View
@@ -124,7 +124,7 @@ Map.prototype.root = function (handler, middleware, options) {
options = {};
}
- path = options.collection ? path.replace(/\/:.*_id/, '') : path;
+ path = options.collection ? path.replace(/\/:[^\/\:]+_id(\/[^\:]+)$/, '$1') : path;
var args = [path];
if (middleware) {

0 comments on commit 390a1fd

Please sign in to comment.