solved the CSRF problem by adding the jquery-rails Gem