質問編集履歴
1
ボタンtagを追加
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
非同期のいいね機能 ボタン
|
1
|
+
非同期のいいね機能 ボタンが反応しない!
|
body
CHANGED
@@ -58,9 +58,9 @@
|
|
58
58
|
```
|
59
59
|
<% if user_signed_in? %>
|
60
60
|
<% if @book.favorited_by?(current_user) %> <!-- ログインしているユーザーがファボしたかどうかで分岐 -->
|
61
|
-
<
|
61
|
+
<button><span>お気に入り解除: </span><%=link_to book.favorites.count, book_favorites_path(book.id), method: :delete, remote: true %></button>
|
62
62
|
<% else %>
|
63
|
-
<
|
63
|
+
<button><span>お気に入り登録: </span><%=link_to book.favorites.count, book_favorites_path(book.id), method: :post, remote: true %></button>
|
64
64
|
<% end %>
|
65
65
|
<% else %>
|
66
66
|
<p><span>お気に入り数: </span><%= book.favorites.count %></p>
|