Delete friendships
This commit is contained in:
parent
9823480917
commit
73cc9c24df
1 changed files with 2 additions and 1 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue