Skip to content

Instantly share code, notes, and snippets.

@askehansen
Last active December 15, 2015 13:19
Show Gist options
  • Save askehansen/5266409 to your computer and use it in GitHub Desktop.
Save askehansen/5266409 to your computer and use it in GitHub Desktop.
jQuery ajax setup for Ruby on Rails
$.ajaxSetup(
{
contentType: "application/json; charset=utf-8",
dataType: "json",
headers: { "X-CSRF-Token": $("meta[name='csrf-token']").attr("content") },
type:"POST"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment