Skip to content

Instantly share code, notes, and snippets.

Created June 27, 2017 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/2f29bc58dc94f9cbaaa4dbe25f5c351f to your computer and use it in GitHub Desktop.
Save anonymous/2f29bc58dc94f9cbaaa4dbe25f5c351f to your computer and use it in GitHub Desktop.
$("#ajax-action2").click( function() {
const AUTH_TOKEN = $("meta[name=csrf-token]").attr("content");
request = $.ajax({
type: "PATCH",
url: "/home/no_js_view_action",
headers: {
'X_CSRF_TOKEN': AUTH_TOKEN,
},
dataType: "json",
data: {
some_data: {}
}
});
request.done(function( msg ) {
$( ".response-div" ).html( msg.data );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment