質問編集履歴
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,12 +24,46 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
![イメージ説明](5ab77060821ce50ec98e1d2cc1a39684.jpeg)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
27
|
```ruby
|
32
28
|
|
29
|
+
発生しているエラー
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
Started POST "/users" for 42.146.57.23 at 2020-05-15 09:45:00 +0000
|
36
|
+
|
37
|
+
Cannot render console from 42.146.57.23! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
|
38
|
+
|
39
|
+
Processing by UsersController#create as HTML
|
40
|
+
|
41
|
+
Parameters: {"utf8"=>"✓", "authenticity_token"=>"oHM11OL6+8sV5fPU0+/m2IL7jwSmzgOledIMmPXfApyGDgADQlhnahbChTYfMbqowReE7wQUoipJC5fLysPniA==", "user"=>{"company"=>"株式会社A", "userid"=>"ユーザーA", "pass"=>"パスワードE", "memo"=>"メモを追加していく", "schedules_attributes"=>{"0"=>{"category_id"=>"1", "time"=>"15時までに提出", "_destroy"=>"false"}}}, "commit"=>"作成"}
|
42
|
+
|
43
|
+
(0.1ms) begin transaction
|
44
|
+
|
45
|
+
(0.0ms) rollback transaction
|
46
|
+
|
47
|
+
Rendering users/new.html.erb within layouts/application
|
48
|
+
|
49
|
+
Category Load (0.1ms) SELECT "categories".* FROM "categories"
|
50
|
+
|
51
|
+
CACHE (0.0ms) SELECT "categories".* FROM "categories"
|
52
|
+
|
53
|
+
Rendered users/_form.html.erb (5.3ms)
|
54
|
+
|
55
|
+
Rendered users/new.html.erb within layouts/application (6.4ms)
|
56
|
+
|
57
|
+
Completed 200 OK in 52ms (Views: 47.7ms | ActiveRecord: 0.3ms)
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
```
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
|
33
67
|
#_form.hyml.erb
|
34
68
|
|
35
69
|
<%= nested_form_for(@user) do |f| %>
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -321,3 +321,47 @@
|
|
321
321
|
|
322
322
|
|
323
323
|
```
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
```ruby
|
328
|
+
|
329
|
+
#user.rb
|
330
|
+
|
331
|
+
class User < ApplicationRecord
|
332
|
+
|
333
|
+
has_many :schedules, dependent: :destroy
|
334
|
+
|
335
|
+
accepts_nested_attributes_for :schedules, allow_destroy: true
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
end
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
#schedule.rb
|
346
|
+
|
347
|
+
class Schedule < ApplicationRecord
|
348
|
+
|
349
|
+
belongs_to :user
|
350
|
+
|
351
|
+
end
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
#category.rb
|
358
|
+
|
359
|
+
class Category < ApplicationRecord
|
360
|
+
|
361
|
+
end
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
```
|
1
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,10 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
+
![イメージ説明](5ab77060821ce50ec98e1d2cc1a39684.jpeg)
|
28
|
+
|
29
|
+
|
30
|
+
|
27
31
|
```ruby
|
28
32
|
|
29
33
|
#_form.hyml.erb
|