回答編集履歴
1
paramsについて追記
test
CHANGED
@@ -10,4 +10,46 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
実際はどう修正すればよいか答えは出ていると思いますが…
|
13
|
+
実際はどう修正すればよいかは提示された `params` の内容を見れば答えは出ていると思いますが…
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
以下、 `params` を簡単に整形したものです。
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
|
23
|
+
{
|
24
|
+
|
25
|
+
"_method" => "patch",
|
26
|
+
|
27
|
+
"authenticity_token" => "t97IYG3YB7yjX9vpWbciTYOyvoz703VQ7nn+OvP3zVhRCTO0BoQUWZTHGh3ucqU7KZ+STb8hQkJuIkB072R7NQ==",
|
28
|
+
|
29
|
+
"board" => {
|
30
|
+
|
31
|
+
"title" => "test",
|
32
|
+
|
33
|
+
"text" => "aa",
|
34
|
+
|
35
|
+
"name" => "aaa",
|
36
|
+
|
37
|
+
"image" => <ActionDispatch::Http::UploadedFile: 0x00007fc34e57e360
|
38
|
+
|
39
|
+
@content_type = "image/jpeg",
|
40
|
+
|
41
|
+
@headers = "Content-Disposition: form-data; name=\"board[image]\"; filename=\"james-harrison-vpOeXr5wmR4-unsplash.jpg\"\r\n" + "Content-Type: image/jpeg\r\n",
|
42
|
+
|
43
|
+
@original_filename = "james-harrison-vpOeXr5wmR4-unsplash.jpg",
|
44
|
+
|
45
|
+
@tempfile = #<File: /var/folders/x2/z7kp1bw579d_9f8399ncppqm0000gn/T/RackMultipart20210428-53629-1j0wl6r.jpg>>
|
46
|
+
|
47
|
+
},
|
48
|
+
|
49
|
+
"commit" => "保存する",
|
50
|
+
|
51
|
+
"id" => "10"
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
```
|