Permalink
Browse files

Fix failing test cases

If a helper name is passed, use it. fixes #4
  • Loading branch information...
1 parent b04e94a commit 383d1662faf3fb79bb20ad55b148f35a89924720 @fsateler fsateler committed Mar 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/railway_routes.js
View
4 lib/railway_routes.js
@@ -109,14 +109,14 @@ Map.prototype.root = function (handler, middleware, options) {
};
});
-Map.prototype.addPath = function (templatePath, action, fallbackHelperName) {
+Map.prototype.addPath = function (templatePath, action, helperName) {
if (templatePath instanceof RegExp) {
// TODO: think about adding to `path_to` routes by reg ex
return;
}
var paramsLength = templatePath.match(/\/:/g);
paramsLength = paramsLength === null ? 0 : paramsLength.length;
- var helperName = this.urlHelperName(templatePath, action) || fallbackHelperName;
+ helperName = helperName || this.urlHelperName(templatePath, action);
// already defined? not need to redefine
if (this.pathTo[helperName]) return;

0 comments on commit 383d166

Please sign in to comment.