Skip to content

Instantly share code, notes, and snippets.

@aeden
Created February 5, 2010 21:32
Show Gist options
  • Select an option

  • Save aeden/296272 to your computer and use it in GitHub Desktop.

Select an option

Save aeden/296272 to your computer and use it in GitHub Desktop.
connectAddForm: function() {
$("form.people").submit(function() {
$.ajax({
type: 'post',
dataType: 'json',
url: '/people',
data: $(this).serialize(),
success: function(json) {
$('ul.people').append('<li><span class="name">' + json.person.name + '</span> <a href="/people/' + json.person.id + '/delete" class="delete">delete</a></li>');
$('#person_name').val('');
}
});
return false;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment