Rails 3 and CSRF tokens

Note to self:

When having troubles with Ajax and CSRF tokens on Rails 3.x, this is the solution:
http://stackoverflow.com/questions/5126721/rails-not-reloading-session-on-ajax-post