I have 2 tables contacts and contact_addresses
In the model contact.rb I wrote:
and in contact_address.rb
Each contact may have more than one address in contact_addresses table.
Inorder to edit the address, I did the following:
In the contact_controller:
@contact_address=ContactAddress.find :all, :conditions => [“contact_id
<%for contact_address in @contact_address
contact_address1 = ContactAddress.new
contact_address1 = contact_address
contact_address2 = ContactAddress.new
contact_address2 = contact_address
<% puts contact_address1.addr_line1 %> //This is working
<% puts contact_address2.addr_line1 %> //This is working
But the above code is not working. The value is not printed in the text
box. Can anyone please help me to find solution to this problem.