diff --git a/app/controllers/friendships_controller.rb b/app/controllers/friendships_controller.rb index 50c12a6..673ae10 100644 --- a/app/controllers/friendships_controller.rb +++ b/app/controllers/friendships_controller.rb @@ -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'