One-to-One: Undefined method build

后端 未结 3 1312
无人共我
无人共我 2020-12-28 18:27

got a problem with one to one relations

I have some Matches and i want to have one score for a match.

my Match.rb

has_one :score, :dependent          


        
3条回答
  •  一生所求
    2020-12-28 19:03

    You can create a score by using the below example

    @match.build_score
    or
    @match.create_score
    

提交回复
热议问题