Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
How to Build A Secure Website With Ruby On Rails 2
var form_data = //.. Serialise a form
// Get token and param from the meta tags
var token = $('meta[name="csrf-token"]').attr('content');
var param = $('meta[name="csrf-param"]').attr('content');
// Create url of "/settings/profile?name=Jeremy+Walker&authenticity_token=askdsalewg303y09sd00dshb0b00ac0dffbafds"
document.location = "/settings/profile?_method=PUT&" + form_data + "&" + token + "=" + param;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment