var Router = View.extend({ route: function(){ this.originalPath = window.location.pathname var path = window.location.pathname.split("/") // console.log(path) for (var route in this.routes) { var routePath = route.split("/") if (routePath[1] == path[1]) { if (routePath[2] && routePath[2].indexOf(":") !== -1 && path[2] && (path[3] === routePath[3]) ) { this[this.routes[route]](null, path[2]) break; } else if (routePath[2] == path[2]) { this[this.routes[route]](null) break; } else if (! routePath[2] && (! path[2].length || ! path[2])) { this[this.routes[route]](null) break; } } } } })