Javascript based game in rails framework