Skip to content

@iHiD /csrf.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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
Something went wrong with that request. Please try again.