Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3 from tbuckley/patch-1

Moved root paths case before split() so it's not testing against an array
  • Loading branch information...
commit c62ed559a5eec55eb5bc8b90480fa4c091b649c3 2 parents ce55575 + 356f8fe
@1602 authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/railway_routes.js
View
6 lib/railway_routes.js
@@ -20,12 +20,12 @@ Map.prototype.urlHelperName = function (path, action) {
path = path.toString().replace(/[^a-z]+/ig, '/');
}
- // remove trailing slashes and split to parts
- path = path.replace(/^\/|\/$/g, '').split('/');
-
// handle root paths
if (path === '' || path === '/') return 'root';
+ // remove trailing slashes and split to parts
+ path = path.replace(/^\/|\/$/g, '').split('/');
+
var helperName = [];
path.forEach(function (token, index, all) {
// skip variables
Please sign in to comment.
Something went wrong with that request. Please try again.