質問編集履歴

2

コードを修正

2020/03/29 06:43

投稿

Shika_Tech
Shika_Tech

スコア13

test CHANGED
File without changes
test CHANGED
@@ -44,9 +44,35 @@
44
44
 
45
45
  routes
46
46
 
47
- ```routes.
47
+ ```routes.rb
48
+
48
-
49
+ Rails.application.routes.draw do
50
+
51
+ root 'top#index'
52
+
53
+
54
+
55
+ devise_for :users, controllers: {
56
+
57
+ registrations: 'users/registrations',
58
+
59
+ sessions: 'users/sessions'
60
+
61
+ }
62
+
63
+
64
+
65
+ resources :users, only: [:show]
66
+
67
+ resources :shops do
68
+
69
+ resources :comments, only: %i[create destroy]
70
+
71
+ resources :likes, only: %i[create destroy]
72
+
49
- コード
73
+ end
74
+
75
+ end
50
76
 
51
77
  ```
52
78
 

1

ログを追加

2020/03/29 06:43

投稿

Shika_Tech
Shika_Tech

スコア13

test CHANGED
File without changes
test CHANGED
@@ -259,3 +259,77 @@
259
259
 
260
260
 
261
261
  以上です。
262
+
263
+
264
+
265
+ ## 追記 ログ
266
+
267
+ 削除ボタン
268
+
269
+ ```
270
+
271
+ I, [2020-03-29T06:35:46.863725 #29210] INFO -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] Started DELETE "/shops/35" for 14.3.50.42 at 2020-03-29 06:35:46 +0000
272
+
273
+ I, [2020-03-29T06:35:46.864435 #29210] INFO -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] Processing by ShopsController#destroy as HTML
274
+
275
+ I, [2020-03-29T06:35:46.864486 #29210] INFO -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] Parameters: {"authenticity_token"=>"rNVjNAdF1me295xZGcP+2ofnAg54t/IS8mHPKxuZpFwg3DpvJekGws4gZNq+PYGZHTE6mXIwoFjtfZHoKSxqIA==", "id"=>"35"}
276
+
277
+ D, [2020-03-29T06:35:46.871138 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] User Load (2.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
278
+
279
+ D, [2020-03-29T06:35:46.874529 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] Shop Load (2.8ms) SELECT `shops`.* FROM `shops` WHERE `shops`.`id` = 35 LIMIT 1
280
+
281
+ D, [2020-03-29T06:35:46.875050 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] CACHE (0.0ms) SELECT `shops`.* FROM `shops` WHERE `shops`.`id` = 35 LIMIT 1 [["id", 35], ["LIMIT", 1]]
282
+
283
+ D, [2020-03-29T06:35:46.878060 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] (2.7ms) BEGIN
284
+
285
+ D, [2020-03-29T06:35:46.881737 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] Comment Load (2.7ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`shop_id` = 35
286
+
287
+ D, [2020-03-29T06:35:46.885304 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] Like Load (2.8ms) SELECT `likes`.* FROM `likes` WHERE `likes`.`shop_id` = 35
288
+
289
+ D, [2020-03-29T06:35:46.888753 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] SQL (2.9ms) DELETE FROM `shops` WHERE `shops`.`id` = 35
290
+
291
+ D, [2020-03-29T06:35:46.894427 #29210] DEBUG -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] (5.3ms) COMMIT
292
+
293
+ I, [2020-03-29T06:35:46.894886 #29210] INFO -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] No template found for ShopsController#destroy, rendering head :no_content
294
+
295
+ I, [2020-03-29T06:35:46.895128 #29210] INFO -- : [4133cce2-cf00-4251-9920-0a69970fa8f4] Completed 204 No Content in 31ms (ActiveRecord: 22.0ms)
296
+
297
+ ```
298
+
299
+ 編集ボタン
300
+
301
+ ```
302
+
303
+ I, [2020-03-29T06:40:08.010756 #29208] INFO -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] Started GET "/shops/36/edit" for 14.3.50.42 at 2020-03-29 06:40:08 +0000
304
+
305
+ I, [2020-03-29T06:40:08.011462 #29208] INFO -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] Processing by ShopsController#edit as HTML
306
+
307
+ I, [2020-03-29T06:40:08.011538 #29208] INFO -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] Parameters: {"id"=>"36"}
308
+
309
+ D, [2020-03-29T06:40:08.018090 #29208] DEBUG -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] User Load (2.8ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
310
+
311
+ D, [2020-03-29T06:40:08.021525 #29208] DEBUG -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] Shop Load (2.8ms) SELECT `shops`.* FROM `shops` WHERE `shops`.`id` = 36 LIMIT 1
312
+
313
+ D, [2020-03-29T06:40:08.022087 #29208] DEBUG -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] CACHE (0.0ms) SELECT `shops`.* FROM `shops` WHERE `shops`.`id` = 36 LIMIT 1 [["id", 36], ["LIMIT", 1]]
314
+
315
+ I, [2020-03-29T06:40:08.022758 #29208] INFO -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] Completed 406 Not Acceptable in 11ms (ActiveRecord: 5.6ms)
316
+
317
+ F, [2020-03-29T06:40:08.023835 #29208] FATAL -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a]
318
+
319
+ F, [2020-03-29T06:40:08.023942 #29208] FATAL -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] ActionController::UnknownFormat (ShopsController#edit is missing a template for this request format and variant.
320
+
321
+
322
+
323
+ request.formats: ["text/html"]
324
+
325
+ request.variant: []
326
+
327
+
328
+
329
+ NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.):
330
+
331
+ F, [2020-03-29T06:40:08.024050 #29208] FATAL -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a]
332
+
333
+ F, [2020-03-29T06:40:08.024191 #29208] FATAL -- : [e038f90c-3c83-4f30-b88d-a6d7e8ffcf2a] actionpack (5.0.7.2) lib/action_controller/metal/implicit_render.rb:56:in `default_render'
334
+
335
+ ```