Fix for passing Rails paths into JS code