javascript working with ruby logic on home.index.html page