質問編集履歴

1

エラ〜文とparamsを全文載せました。

2020/03/15 11:07

投稿

SomaSekimoto
SomaSekimoto

スコア9

test CHANGED
File without changes
test CHANGED
@@ -26,9 +26,25 @@
26
26
 
27
27
  ```error
28
28
 
29
- NoMethodError in ItemsController#create
29
+ NoMethodError in ItemsController#create
30
-
30
+
31
- undefined method `id' for "6":String
31
+ undefined method `id' for "6":String
32
+
33
+
34
+
35
+ => @item = Item.new(item_params)
36
+
37
+
38
+
39
+ if @item.save!
40
+
41
+
42
+
43
+ app/controllers/items_controller.rb:68:in `create'
44
+
45
+
46
+
47
+
32
48
 
33
49
  ```
34
50
 
@@ -64,13 +80,43 @@
64
80
 
65
81
  ```parameters
66
82
 
67
- "name"=>"hhhh",
68
-
69
- "description"=>"gagagga",
70
-
71
- "parent_name"=>"メンズ",
72
-
73
- "brand_id"=>"1",
83
+ Parameters:
84
+
85
+
86
+
87
+ {"utf8"=>"",
88
+
89
+ "authenticity_token"=>"6EPm8+xm+3boKu3Zx4u3eooAgiUncilmAVXHTnGu6HTk6HnSpJoo7JvcNxgedr83SVz1biocFprLjYFJX/ZWzg==",
90
+
91
+ "item"=>
92
+
93
+ {"images_attributes"=>
94
+
95
+ {"0"=>
96
+
97
+ {"content"=>
98
+
99
+ #<ActionDispatch::Http::UploadedFile:0x00007fc25a0625d8
100
+
101
+ @content_type="image/jpeg",
102
+
103
+ @headers=
104
+
105
+ "Content-Disposition: form-data; name=\"item[images_attributes][0][content]\"; filename=\"\xE3\x82\xBF\xE3\x82\x99\xE3\x82\xA6\xE3\x83\xB3\xE3\x83\xAD\xE3\x83\xBC\xE3\x83\x88\xE3\x82\x99 (1).jpeg\"\r\n" +
106
+
107
+ "Content-Type: image/jpeg\r\n",
108
+
109
+ @original_filename="ダウンロード (1).jpeg",
110
+
111
+ @tempfile=#<File:/var/folders/mk/8f7vv9q95xdf64s6pz1dk_vr0000gn/T/RackMultipart20200315-58575-1ujrxyn.jpeg>>}},
112
+
113
+ "name"=>"aaaa",
114
+
115
+ "description"=>"bbbbb",
116
+
117
+ "parent_name"=>"レディース",
118
+
119
+ "brand_id"=>"3",
74
120
 
75
121
  "condition"=>"6",
76
122
 
@@ -78,11 +124,11 @@
78
124
 
79
125
  "shipping_days"=>"1",
80
126
 
81
- "area"=>"青森県",
127
+ "area"=>"秋田県",
82
-
128
+
83
- "price"=>"4444"},
129
+ "price"=>"5000"},
84
-
130
+
85
- "category_id"=>"101",
131
+ "category_id"=>"21",
86
132
 
87
133
  "commit"=>"出品する"}
88
134