If an Object has two has_many associations, how do I create a new Object?

Posted by Angela on Stack Overflow See other posts from Stack Overflow or by Angela
Published on 2010-04-22T05:24:17Z Indexed on 2010/04/22 5:33 UTC
Read the original article Hit count: 188

Filed under:

I have an object (Contacts) which has two has_many relationships: Campaign and Company

When I am in the Campaign view, I want to add a Contact.

But without a Company_Id, Controller says cannot find company_id (which needs to be there if I add a Contact through the Company).

What should I do?

© Stack Overflow or respective owner

Related posts about has-many