我的Rails应用程序有一个有兴趣和假期HABTM关系的用户模型。这两个(兴趣和假期)只有一个属性需要编辑并与用户相关。这是设置和工作正常。设置Rails模型关联
我需要创建一个新的模式称为friend_birthday这就是包含有关的用户朋友(和各自的利益)的生日信息。这个模型(friend_birthday)需要有几个属性(:name,:gender,:dob和:interests)。
我想上使用的has_many/belongs_to的这一个。用户有许多friends_birthdays和friends_birthdays belongs_to用户。
听起来不错?我怎么能实现这个?
谢谢!
你看的has_many:通过? http://guides.rubyonrails.org/association_basics.html – Brett