LoginSignup
4
2

More than 5 years have passed since last update.

form_for undefined method `merge' for @hogehoge.id

Posted at

よく忘れるのでメモ

= f.hidden_field :hoge_id, @hogehoge.id

これだとundefined method `merge' for @hogehoge.id :integerが帰ってきそうなので

= f.hidden_field :hoge_id, value: @hogehoge_id

明示的にオプションを渡してあげる

ご参考

4
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2