1. html
<%= hidden_field_tag :authenticity_token, form_authenticity_token, id: 'this id' %>
2. js
var csrf = $("input#this id").val();
headers: {
'X-CSRF-Token': csrf
}
# the headers set in ajax
1. html
<%= hidden_field_tag :authenticity_token, form_authenticity_token, id: 'this id' %>
2. js
var csrf = $("input#this id").val();
headers: {
'X-CSRF-Token': csrf
}
# the headers set in ajax