Deeply nested Rails forms using belong_to not working?
问题 I'm working on a messy form which among other things has to manage a section with two-level nesting. It's almost working, but there's a snag and the only thing I can see that's different from other deeply-nested forms that work is that there's a belongs_to relationship rather than has_many. Here are the models: Event has_many :company_events, :dependent => :destroy accepts_nested_attributes_for :company_events CompanyEvent belongs_to :company accepts_nested_attributes_for :company, :update