Skip to content

Instantly share code, notes, and snippets.

@christopherdbull
Created June 28, 2012 03:40
Show Gist options
  • Save christopherdbull/3008813 to your computer and use it in GitHub Desktop.
Save christopherdbull/3008813 to your computer and use it in GitHub Desktop.
$("#add_friend").on('ajax:success', function(data, status, xhr){
console.log(this);
console.log($(this));
$(this).after('<p>Friend request successfully sent! And now you wait</p>').fadeIn('slow');
$(this).remove().fadeOut('slow');
});
= link_to "Someone Friend this Fucker", friendships_path(:user_id => current_user.id, :friend_id => @user.id), :remote => true, :method => :post, :id => 'add_friend'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment