rightjs/rightjs-plugins — comment on commit f933b838dfdac32d219f39b6fd0856d58cefba83
File:  line 0
By MadRabbit:

I've made it working. Basically the problem is that right-rails.js adds the CSRF params when `dom-ready` fires up, so that we were sure that all the scripts are loaded and the meta tags are in place. Your script was inlined and fired in the middle of the loading process _before_ dom-ready fired up and right-rails do its magic.

So you can either move your code into a dom-ready callback like I did, or inline the auth-tokens in your javascript as you did before.