https://github.com/railsware/js-routes/blob/master/lib/routes.js#L146-L152