質問編集履歴

1

エラー状況の追記

2020/05/19 04:51

投稿

sngw
sngw

スコア0

test CHANGED
File without changes
test CHANGED
@@ -229,3 +229,65 @@
229
229
  どなたかお助けいただけませんか?
230
230
 
231
231
  よろしくお願いします。
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+ ### エラーについて追記します-2020/05/19
242
+
243
+ ```terminal
244
+
245
+ Started POST "/uploads" for ::1 at 2020-05-19 13:46:50 +0900
246
+
247
+ Processing by UploadsController#create as */*
248
+
249
+ Parameters: {"upload"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0x00007fc262966fc8 @tempfile=#<Tempfile:/var/folders/1v/z9ljm971349c50_qs5f5wy_h0000gn/T/RackMultipart20200519-19326-wz6m90.jpg>, @original_filename="jiyu.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload[image]\"; filename=\"jiyu.jpg\"\r\nContent-Type: image/jpeg\r\n">}}
250
+
251
+ (0.1ms) begin transaction
252
+
253
+ SQL (0.5ms) INSERT INTO "uploads" ("image", "created_at", "updated_at") VALUES (?, ?, ?) [["image", "dtcgxdmlua3jd5ddxkpg.png"], ["created_at", "2020-05-19 04:46:50.050482"], ["updated_at", "2020-05-19 04:46:50.050482"]]
254
+
255
+ SQL (0.1ms) UPDATE "uploads" SET "image" = 'image/upload/v1589863584/dtcgxdmlua3jd5ddxkpg.png' WHERE "uploads"."id" = ? [["id", 7]]
256
+
257
+ (1.6ms) commit transaction
258
+
259
+ Completed 200 OK in 1710ms (Views: 0.2ms | ActiveRecord: 2.4ms)
260
+
261
+
262
+
263
+
264
+
265
+ Started GET "/posts/null" for ::1 at 2020-05-19 13:46:51 +0900
266
+
267
+ Processing by PostsController#show as HTML
268
+
269
+ Parameters: {"id"=>"null"}
270
+
271
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
272
+
273
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT ? [["id", 0], ["LIMIT", 1]]
274
+
275
+ Completed 404 Not Found in 4ms (ActiveRecord: 0.6ms)
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+ ActiveRecord::RecordNotFound (Couldn't find Post with 'id'=null):
284
+
285
+ ```
286
+
287
+
288
+
289
+ cloudinaryのダッシュボードを確認すると、選択した画像が保存されていることがわかりましたが
290
+
291
+ 画像の表示がおかしくなる
292
+
293
+ ![イメージ説明](65cf9d64e7b53aa53f4580790374a528.png)