I’m going nuts on a very simple issue. I know what I want but don’t know
to tell rails to do so. I have a very common setup for managing
companies table and a contacts table. As you’ve guessed it’s a one to
The database is setup with the appropriate foreign keys, the models have
generated and I added the “has_many :contacts” and “belongs_to :company”
the appropriate models
Having put scaffolds in place and wanting to add a contact, when saving
ActiveRecord::AssociationTypeMismatch in Work#create
Company expected, got String
(I don’t now what “Company” represents in this case (model, column or
What I eventually want when adding a contact is having a dropdown list
the company names so the relation is established.
I have the agile book, and the example webshop was a very clear. But I
seem to implement this. Are there any easy online step-by-step tutorials
to go about this, because I’m losing it.
Thanx a lot!