回答編集履歴

1

修正

2019/01/08 05:53

投稿

退会済みユーザー
test CHANGED
@@ -1,15 +1,29 @@
1
- > ```rb
2
-
3
- assigns(:product)
1
+ []とか()はどっちでもよさそうでした。
4
-
5
- > ```
6
2
 
7
3
 
8
4
 
9
- ```rb
5
+ 期待される値
10
-
11
- assigns[:product]
12
-
13
- # ^ ^
14
6
 
15
7
  ```
8
+
9
+ [#<Spree::Product id: 576, name: "Product #20 - 5006", description: "As seen on TV!", available_on: "...at: "2019-01-08 04:48:35", updated_at: "2019-01-08 04:48:35", promotionable: true, meta_title: nil>]
10
+
11
+ ```
12
+
13
+ 取得した値
14
+
15
+ ```
16
+
17
+ []
18
+
19
+ ```
20
+
21
+ 不足分
22
+
23
+ ```
24
+
25
+ [#<Spree::Product id: 576, name: "Product #20 - 5006", description: "As seen on TV!", available_on: "...at: "2019-01-08 04:48:35", updated_at: "2019-01-08 04:48:35", promotionable: true, meta_title: nil>]
26
+
27
+ ```
28
+
29
+ となってるのでプロダクトコードのインスタンス変数が空の配列になってるのではないでしょうか。