Forum: Ruby on Rails RE: Design Question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-01-10 03:11
(Received via mailing list)
Hi Jan,
Thanks for your reply. My concern is the best practices for doing this
inside Rails. Also I was looking for exmaple code for doing this in
Rails and not the schema design

Jan P. (Guest)
on 2006-01-10 11:09
(Received via mailing list)
Hi, Silvy,

ok. That is as easy as

class Person < ActiveRecord::Base
  has_many :addresses [ has_and_belongs_to_many :addresses ]


class Address < ActiveRecord::Base
  belongs_to :person [ has_and_belongs_to_many :persons ]

but there is quite some material in each and every tutorial (and the
introduction video) you'll find on .
rails - in contrast to many other open source projects - is very well
documented. I suggest you work through some of these!

This topic is locked and can not be replied to.