Skip to content

Commit

Permalink
レビュー対応
Browse files Browse the repository at this point in the history
  • Loading branch information
KOH6 committed Sep 24, 2023
1 parent 7166f6a commit 41badb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/likes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def create
end

def destroy
@like = Like.find_by(post_id: params[:post_id], user_id: current_user.id)
@like = current_user.likes.find_by(post_id: params[:post_id])
@like.destroy
redirect_to request.referer
end
Expand Down

0 comments on commit 41badb1

Please sign in to comment.