标签: ruby-on-rails-3
我有两个模特,我想知道如何建立这种关系。必须是一比一。
答案 0 :(得分:1)
我必须编辑模型。我在模型中使用“belongs_to”然后使用外键并在另一个模型中使用has_one。