質問編集履歴

2

タイトル

2021/07/27 08:42

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- undefined method `read' for nil:NilClass
1
+ 画像投稿でのnil:NilClass
test CHANGED
File without changes

1

logの追記

2021/07/27 08:42

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -367,3 +367,57 @@
367
367
 
368
368
 
369
369
  ```
370
+
371
+
372
+
373
+ ### 追記
374
+
375
+ ``` log
376
+
377
+ ##### log
378
+
379
+
380
+
381
+ Started POST "/posts" for 172.23.0.1 at 2021-07-27 04:53:14 +0000
382
+
383
+ Cannot render console from 172.23.0.1! Allowed networks: 127.0.0.0/127.255.255.255, ::1
384
+
385
+ Processing by PostsController#create as HTML
386
+
387
+ Parameters: {"authenticity_token"=>"Fzd0AqvM5+OLg8/Dy4WdfYraF7hjMvBxrMckycOMuxOyHlatXvlhq96CgvRYL7Fnmp7E+6VPlqUp1tfULrlRgA==", "post"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0x00007efcc96dbbc8 @tempfile=#<Tempfile:/tmp/RackMultipart20210727-1-wwif4s.jpeg>, @original_filename="キャンプテントのアイコン素材.jpeg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"post[image]\"; filename=\"\xE3\x82\xAD\xE3\x83\xA3\xE3\x83\xB3\xE3\x83\x95\xE3\x82\x9A\xE3\x83\x86\xE3\x83\xB3\xE3\x83\x88\xE3\x81\xAE\xE3\x82\xA2\xE3\x82\xA4\xE3\x82\xB3\xE3\x83\xB3\xE7\xB4\xA0\xE6\x9D\x90.jpeg\"\r\nContent-Type: image/jpeg\r\n">, "image_title"=>"い", "description"=>"い", "items_attributes"=>{"0"=>{"products_name"=>"い", "brand"=>"い", "size"=>"い", "price"=>"い", "_destroy"=>"false"}}}}
388
+
389
+ User Load (0.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 5 LIMIT 1
390
+
391
+ ↳ app/controllers/application_controller.rb:14:in `set_current_user'
392
+
393
+ Unpermitted parameter: :_destroy
394
+
395
+ CACHE User Load (0.0ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 5 LIMIT 1 [["id", 5], ["LIMIT", 1]]
396
+
397
+ ↳ app/models/post.rb:11:in `user'
398
+
399
+ (0.5ms) BEGIN
400
+
401
+ ↳ app/controllers/posts_controller.rb:21:in `create'
402
+
403
+ Post Create (1.3ms) INSERT INTO `posts` (`created_at`, `updated_at`, `description`, `image_title`, `image`, `user_id`) VALUES ('2021-07-27 04:53:14.247719', '2021-07-27 04:53:14.247719', 'い', 'い', '#<ActionDispatch::Http::UploadedFile:0x00007efcc96dbbc8>', 5)
404
+
405
+ ↳ app/controllers/posts_controller.rb:21:in `create'
406
+
407
+ Item Create (0.7ms) INSERT INTO `items` (`brand`, `size`, `price`, `products_name`, `created_at`, `updated_at`, `post_id`) VALUES ('い', 'い', 0, 'い', '2021-07-27 04:53:14.262827', '2021-07-27 04:53:14.262827', 62)
408
+
409
+ ↳ app/controllers/posts_controller.rb:21:in `create'
410
+
411
+ (2.0ms) COMMIT
412
+
413
+ ↳ app/controllers/posts_controller.rb:21:in `create'
414
+
415
+ Completed 500 Internal Server Error in 46ms (ActiveRecord: 5.2ms | Allocations: 6830)
416
+
417
+ NoMethodError (undefined method `read' for nil:NilClass):
418
+
419
+ app/controllers/posts_controller.rb:24:in `create'
420
+
421
+
422
+
423
+ ```