Link to first question: Ruby on Rails and Jquery: trying to switch characters after submit
I asked this question yesterday, and got what I believe to be some helpful fee
Check your Javascript error console, that's not valid syntax, you need to quote the id for the table.
var currentPlayer = $('#table').data("current-player");