Skip to content

Instantly share code, notes, and snippets.

@matthooks
Created October 14, 2008 06:56
Show Gist options
  • Save matthooks/16677 to your computer and use it in GitHub Desktop.
Save matthooks/16677 to your computer and use it in GitHub Desktop.
$('.remote_form').submit(function() {
var form = $(this);
var data = form.serializeArray();
data.push({authenticity_token: AUTH_TOKEN});
$.ajax({
url : form.attr('action'),
type : form.attr('method') || 'GET',
data : data,
success: function(response) {
// do replacement
}
});
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment