<% require "rails-routes-js-utils" %> window.Routes = {}; window.AllRoutes = []; function addRouteToEnv(obj) { window.Routes[obj.name+'_path'] = function(idOrObject){ if (typeof idOrObject == 'object') return obj.replace(idOrObject); var param= {}; for (var i=0;i