質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -139,3 +139,37 @@
|
|
139
139
|
```
|
140
140
|
|
141
141
|
少なくともnameは間違えていないように思えるのですが、わかるかたいらっしゃいますでしょうか?
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
ちなみに.save前にbinding.pryをかませてインスタンス生成の値とそのsaveの値を見ると以下です。
|
146
|
+
|
147
|
+
```
|
148
|
+
|
149
|
+
6: def create
|
150
|
+
|
151
|
+
7: g = Group.new(group_params)
|
152
|
+
|
153
|
+
8: binding.pry
|
154
|
+
|
155
|
+
=> 9: g.save
|
156
|
+
|
157
|
+
10: end
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
[1] pry(#<GroupsController>)> g
|
162
|
+
|
163
|
+
=> #<Group:0x00007fee578cbbd8 id: nil, name: "df", created_at: nil, updated_at: nil>
|
164
|
+
|
165
|
+
[2] pry(#<GroupsController>)> g.save
|
166
|
+
|
167
|
+
(0.3ms) BEGIN
|
168
|
+
|
169
|
+
(0.3ms) ROLLBACK
|
170
|
+
|
171
|
+
NoMethodError: undefined method `name' for #<GroupsUser:0x00007fee5ef57770>
|
172
|
+
|
173
|
+
from /Users/handaryouhei/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activemodel-5.0.7.2/lib/active_model/attribute_methods.rb:433:in `method_missing'
|
174
|
+
|
175
|
+
```
|