title: WARNING: Can't verify CSRF token authenticity rails
body: <p>I am sending data from view to controller with AJAXand I got this error:</p>
  
  <blockquote>
    <p>WARNING: Can't verify CSRF token authenticity</p>
  </blockquote>
  
  <p>I think I have to send this token with data.</p>
  
  <p>Does anyone know how can I do this ?</p>
  
  <p><strong>Edit: My solution</strong></p>
  
  <p>I did this by putting the following code inside the AJAX post:</p>
  
  <pre><code>headers: {
    'X-Transaction': 'POST Example',
    'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
  },
  </code></pre>