mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Include CSRF token in remote:true calls
This commit is contained in:
@@ -31,7 +31,12 @@
|
||||
} else {
|
||||
method = element.attr('data-method');
|
||||
url = element.attr('href');
|
||||
data = null;
|
||||
|
||||
csrf_token = $('meta[name=csrf-token]').attr('content');
|
||||
csrf_param = $('meta[name=csrf-param]').attr('content');
|
||||
|
||||
data = {};
|
||||
data[csrf_param] = csrf_token;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
|
||||
Reference in New Issue
Block a user