Add Rails CSRF protection

I am using Dropzone together with Rails which requires a CSRF token to be sent with every request.
rails/jquery-rails contains a JS file that you can include in your Rails views and that (among other things) automatically adds the required header containing the CSRF token to every Ajax request.
I added a check to Dropzone to use the function from rails/jquery-rails (if present) to add those headers.

I realize you might not want to merge this to support Rails specifically but maybe a callback before sending the request would be an option? (the necessary header could then be added in the callback)