Closed sibinx7 closed 3 years ago
Temporarily fixed with this, but my website sends lots of ajax call to different APIs like Stripe.
var token = $('meta[name="csrf-token"]').attr('content')
$.ajaxSetup({
beforeSend: function(xhr){
xhr.setRequestHeader('X-CSRF-Token', token)
}
})
@sibinx7 - Not sure if this is helpful or not, but I am using the gem in a Rail 5 production environment on my own Fork of the project:
https://github.com/aldefouw/Country-State-Select/tree/alcd-development
Works great for me without any authenticity token errors.
Using same but not getting any error
Gem:
gem 'country_state_select', git: 'git://github.com/arvindvyas/Country-State-Select', branch: :master
Rails: 5+ Ruby: 2.4.1