How to create an association between two rails models

后端 未结 5 1135
南笙
南笙 2021-01-16 12:07

This is a newbie question, but I\'m still learning how to create an association between two models in rails. I have a user model and a journal_entry model. The journal entri

5条回答
  •  滥情空心
    2021-01-16 13:01

    You need to add user_id to your attr_accessible call, if you look at your logs it is probably warning you that it can't mass assign it.

提交回复
热议问题