回答編集履歴
2
言葉遣いの修正
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
microposts/index.html.haml
|
6
6
|
|
7
|
-
ーーーーーーーーー
|
7
|
+
ーーーーーーーーー
|
8
8
|
|
9
9
|
|ポスト1 [いいね!]|
|
10
10
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|ポスト3 [いいね!]|
|
14
14
|
|
15
|
-
ーーーーーーーーー
|
15
|
+
ーーーーーーーーー
|
16
16
|
|
17
17
|
|
18
18
|
|
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
-
具体的には、下記のよう
|
25
|
+
具体的には、下記のように書けばできると思います。
|
26
26
|
|
27
27
|
|
28
28
|
|
1
誤字修正
test
CHANGED
@@ -56,21 +56,21 @@
|
|
56
56
|
|
57
57
|
#いいねボタン
|
58
58
|
|
59
|
-
if current_user.likes.find_by(t
|
59
|
+
if current_user.likes.find_by(micropost_id: micropost.id)
|
60
60
|
|
61
|
-
= link_to unlike_path(t
|
61
|
+
= link_to unlike_path(micropost.id), method: :delete, remote: true do
|
62
62
|
|
63
|
-
.btn.btn-default.glyphicon.glyphicon-heart{id: "heart-#{t
|
63
|
+
.btn.btn-default.glyphicon.glyphicon-heart{id: "heart-#{micropost.id}"}
|
64
64
|
|
65
|
-
= t
|
65
|
+
= micropost.likes.count.to_s
|
66
66
|
|
67
67
|
- else
|
68
68
|
|
69
|
-
= link_to like_path(t
|
69
|
+
= link_to like_path(micropost.id), method: :post, remote: true do
|
70
70
|
|
71
|
-
.btn.btn-default.glyphicon.glyphicon-heart-empty{id: "heart-#{t
|
71
|
+
.btn.btn-default.glyphicon.glyphicon-heart-empty{id: "heart-#{micropost.id}"}
|
72
72
|
|
73
|
-
= t
|
73
|
+
= micropost.likes.count.to_s
|
74
74
|
|
75
75
|
```
|
76
76
|
|