Use Ruby methods in JavaScript