Rails and JavaScript implementation of Tic Tac Toe