質問編集履歴
1
モデルを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -28,4 +28,19 @@
|
|
28
28
|
AND plans.date='2017-05-28'; /* WHEREではなくAND */
|
29
29
|
```
|
30
30
|
|
31
|
-
どうぞ宜しくお願い致します。
|
31
|
+
どうぞ宜しくお願い致します。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
【2017/05/29モデルを追記】
|
36
|
+
```ruby
|
37
|
+
class Employee < ApplicationRecord
|
38
|
+
has_many :plans
|
39
|
+
accepts_nested_attributes_for :plans, reject_if: :all_blank, allow_destroy: true
|
40
|
+
end
|
41
|
+
|
42
|
+
class Plan < ApplicationRecord
|
43
|
+
belongs_to :employee
|
44
|
+
end
|
45
|
+
|
46
|
+
```
|