質問編集履歴

1

routes.rbとlog/development.log の該当部分を記載いたしました。

2022/01/06 13:55

投稿

istone
istone

スコア2

test CHANGED
File without changes
test CHANGED
@@ -78,6 +78,30 @@
78
78
 
79
79
  ### 該当のソースコード
80
80
 
81
+ route.rb
82
+
83
+
84
+
85
+ ```
86
+
87
+ Rails.application.routes.draw do
88
+
89
+ resources :folders do
90
+
91
+ resources :records do
92
+
93
+ resources :memos
94
+
95
+ end
96
+
97
+ end
98
+
99
+ devise_for :users
100
+
101
+ end
102
+
103
+ ```
104
+
81
105
 
82
106
 
83
107
  **モデル**
@@ -292,6 +316,48 @@
292
316
 
293
317
  ```
294
318
 
319
+ log/development.log
320
+
321
+ ```
322
+
323
+ Started GET "/folders/3/records/3/memos/22/edit" for 122.222.88.207 at 2022-01-06 13:47:00 +0000
324
+
325
+ Cannot render console from 122.222.88.207! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
326
+
327
+ Processing by MemosController#edit as HTML
328
+
329
+ Parameters: {"folder_id"=>"3", "record_id"=>"3", "id"=>"22"}
330
+
331
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
332
+
333
+ ↳ /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activerecord-5.2.6/lib/active_record/log_subscriber.rb:98
334
+
335
+ Folder Load (0.1ms) SELECT "folders".* FROM "folders" WHERE "folders"."user_id" = ? AND "folders"."id" = ? LIMIT ? [["user_id", 1], ["id", 3], ["LIMIT", 1]]
336
+
337
+ ↳ app/controllers/memos_controller.rb:49
338
+
339
+ Record Load (0.1ms) SELECT "records".* FROM "records" WHERE "records"."folder_id" = ? AND "records"."id" = ? LIMIT ? [["folder_id", 3], ["id", 3], ["LIMIT", 1]]
340
+
341
+ ↳ app/controllers/memos_controller.rb:54
342
+
343
+ Memo Load (0.2ms) SELECT "memos".* FROM "memos" WHERE "memos"."record_id" = ? AND (22) LIMIT ? [["record_id", 3], ["LIMIT", 1]]
344
+
345
+ ↳ app/controllers/memos_controller.rb:59
346
+
347
+ Rendering memos/edit.html.erb within layouts/application
348
+
349
+ Rendered memos/_form.html.erb (8.8ms)
350
+
351
+ Rendered memos/edit.html.erb within layouts/application (11.0ms)
352
+
353
+ Rendered layouts/_header.html.erb (0.7ms)
354
+
355
+ Completed 200 OK in 128ms (Views: 116.1ms | ActiveRecord: 0.5ms)
356
+
357
+ ```
358
+
359
+ ここでは "id"=>"22" となっていますが、実際のeditの表示はid=18の表示になっています。
360
+
295
361
 
296
362
 
297
363
  ### 試したこと