working within rails framework
refactor board.js