Hi all,

I have a relationship in this form: A person belongs to an address and a
address can have many persons like below:

class Person < ActiveRecord::Base
  belongs_to :address
end

class Address < ActiveRecord::Base
  has_many: persons
end

The ideia behind this is, if two or more persons share the same address,
isn't necessary create two indetical rows in the database. But, like i'm
new in the rails development, i want to create a form for person
creation and edition that wraps the creation of related address, as a
nested form. I already made a search for a solution for this problem,
but the solutions that i found in others sites are for the inverse
associations, any idea?

Thanks.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to