I have a problem I can’t seem to find an answer to. I have the
following relations
(contact) 1 == *(Phone) *== (Phone Type).
(contact) 1 == 1 (Address)
I will be constructing an AJAX interface that allows user to add
multiple rows to the contact. As such, I want to make it possible to
get them from the request. I have the following for contact and
address, which works
@company_contact = CompanyContact.new(params[:company_contact])
@address = Address.new(params[:address])
@company = Company.find(params[:company])
@company_contact.company = @company
@company_contact = @address
#TODO phones.
How do I get the phones to work? I’ve tried the following.
@phones = Phone.new(params[:phones])
but it doesn’t return anything, just nill. My embedded form looks
like this.
Phones
Number: | <%= text_field("phone" , "number") %> | <%= get_phone_types %> |
Number: | business fax home mobile | |
Number: | business fax home mobile | |
Number: | business fax home mobile | |
Number: | business fax home mobile |