質問編集履歴
2
ソースコード編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,11 +44,7 @@
|
|
44
44
|
|
45
45
|
def show
|
46
46
|
|
47
|
-
@genres = Genre.all
|
48
|
-
|
49
47
|
@product = Product.find(params[:id])
|
50
|
-
|
51
|
-
@new_product_in_cart = ProductInCart.new
|
52
48
|
|
53
49
|
@stock_quantity_array = []
|
54
50
|
|
1
ソースコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,6 +36,34 @@
|
|
36
36
|
|
37
37
|
```
|
38
38
|
|
39
|
+
### ソースコード
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
```
|
44
|
+
|
45
|
+
def show
|
46
|
+
|
47
|
+
@genres = Genre.all
|
48
|
+
|
49
|
+
@product = Product.find(params[:id])
|
50
|
+
|
51
|
+
@new_product_in_cart = ProductInCart.new
|
52
|
+
|
53
|
+
@stock_quantity_array = []
|
54
|
+
|
55
|
+
@product.stock_quantity.times do |quantity|
|
56
|
+
|
57
|
+
@stock_quantity_array += quantity + 1
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
```
|
64
|
+
|
65
|
+
|
66
|
+
|
39
67
|
### 試したこと
|
40
68
|
|
41
69
|
|