title: Rails 3.1 - CSRF ignored?
body: <p>here my problem,</p>
  
  <p>I've got a rails 3.1 app and I'm trying to make an ajax request but I get the warning message <strong>"WARNING: Can't verify CSRF token authenticity"…</strong></p>
  
  <p>Inside my layout I've got the helper method <strong>"csrf_method_tag"</strong>, and I add the following javascript code (don't know if it's really required or not):</p>
  
  <pre><code>$.ajaxSetup({
    beforeSend: function(xhr) {
      xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
    }
  });
  </code></pre>
  
  <p>My Gemfile contains the gem <strong>jquery-rails</strong> (>= 1.0.12) and I require jquery &amp; jquery-ujs at the top of my application.js.</p>
  
  <p>Even with that, the message still appears. Did i forget something?</p>
  
  <p>Thanks for you help.</p>