Using: Rails 3.0.7 Devise 1.4.5 jquery-rails 1.0.14
When posting data via ajax, Devise is not setting current_donor.
My request header looks like this:
I had the same problem before. I solved it by including csrf_token as below
$.ajax({
type: "GET",
url: url,
data: params ,
beforeSend: function(jqXHR, settings) {
jqXHR.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
},
error: function(){
alert("An error ocurred");
},
success: function(){
}
});