1
0
Fork 0

Delete friendships

This commit is contained in:
Andrew Tomaka 2014-10-24 11:26:44 -04:00
parent 9823480917
commit 73cc9c24df
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ class FriendshipsController < ApplicationController
end
def destroy
@friendship = Friendship.find(params[:id])
@friendship = Friendship.where(user_id: current_user.id,
friend_id: params[:id]).take
@friendship.destroy
flash[:success] = 'Friend has been removed from your friends'