質問するログイン新規登録

質問編集履歴

2

誤時により修正

2020/05/30 08:02

投稿

shun0211
shun0211

スコア4

title CHANGED
File without changes
body CHANGED
@@ -9,7 +9,7 @@
9
9
  ```terminal
10
10
  ActionView::Template::Error (undefined method `liked_by?' for nil:NilClass):
11
11
  1: - if user_signed_in?
12
- 2: - if @set_list.liked_by?(current_user)
12
+ 2: - if set_list.liked_by?(current_user)
13
13
  3: = link_to event_set_list_likes_path(event, set_list), method: :delete, remote: true do
14
14
  4: .like__box
15
15
  5: .heart__mark__unregistered
@@ -46,7 +46,7 @@
46
46
  【部分テンプレート】
47
47
  ```likehtmlhaml
48
48
  - if user_signed_in?
49
- - if @set_list.liked_by?(current_user)
49
+ - if set_list.liked_by?(current_user)
50
50
  = link_to event_set_list_likes_path(event, set_list), method: :delete, remote: true do
51
51
  .like__box
52
52
  .heart__mark__unregistered

1

参考にしたサイトの追加

2020/05/30 08:02

投稿

shun0211
shun0211

スコア4

title CHANGED
File without changes
body CHANGED
@@ -38,6 +38,11 @@
38
38
 
39
39
  部分テンプレートからではなくviewに同じ記載をすると上記のようなエラーはでません。
40
40
 
41
+ ### 参考にしたサイト
42
+ https://qiita.com/naberina/items/c6b5c8d7756cb882fb20
43
+ https://qiita.com/fumikao/items/373caa60b77f27f2dbdd
44
+
45
+
41
46
  【部分テンプレート】
42
47
  ```likehtmlhaml
43
48
  - if user_signed_in?