質問編集履歴

1

モデルを追記

2017/05/29 02:09

投稿

pecchan
pecchan

スコア555

test CHANGED
File without changes
test CHANGED
@@ -59,3 +59,33 @@
59
59
 
60
60
 
61
61
  どうぞ宜しくお願い致します。
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+ 【2017/05/29モデルを追記】
70
+
71
+ ```ruby
72
+
73
+ class Employee < ApplicationRecord
74
+
75
+ has_many :plans
76
+
77
+ accepts_nested_attributes_for :plans, reject_if: :all_blank, allow_destroy: true
78
+
79
+ end
80
+
81
+
82
+
83
+ class Plan < ApplicationRecord
84
+
85
+ belongs_to :employee
86
+
87
+ end
88
+
89
+
90
+
91
+ ```