From c82f47bdda59859fadc2d88a44bc1abcfec4b161 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 12 Feb 2017 15:34:28 +1300 Subject: [PATCH] Pass the ID from link to likesdestroy --- app/views/posts/_single.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/posts/_single.html.haml b/app/views/posts/_single.html.haml index ccd296899..8b84160f5 100644 --- a/app/views/posts/_single.html.haml +++ b/app/views/posts/_single.html.haml @@ -46,7 +46,7 @@ - else - like = post.likes.find_by(member: current_member) - if like && can?(:destroy, like) - = link_to 'Unlike', like_path(like, format: :json), + = link_to 'Unlike', like_path(id: like.id, format: :json), method: :delete, remote: true, class: 'post-like'