質問編集履歴
1
スペルミスを直しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
<!-- お気に入りが存在するときの処理 -->
|
43
43
|
<% if Favorite.exists?(user_id:current_user.id, book_id: @book.id) %>
|
44
44
|
<% favorite= Favorite.find_by(book_id: @book.id) %>
|
45
|
-
<%= button_to book_favorite_path(favorite, book_id: @book.id), method: :delete, class: "
|
45
|
+
<%= button_to book_favorite_path(favorite, book_id: @book.id), method: :delete, class: "favorite-buttons", remote: true do %>
|
46
46
|
<%= image_tag("star-on.png") %>
|
47
47
|
<span>
|
48
48
|
<%= @book.favorites_count %>
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<% end %>
|
51
51
|
<!-- お気に入りが存在しないときの処理 -->
|
52
52
|
<% else %>
|
53
|
-
<%= button_to book_favorites_path(@book), class: "
|
53
|
+
<%= button_to book_favorites_path(@book), class: "favorite-buttons", remote: true, cache: false do %>
|
54
54
|
<%= image_tag("star-off.png") %>
|
55
55
|
<span>
|
56
56
|
<%= @book.favorites_count %>
|