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.
5190273ecab4b93b2d4e7529dcc1f7c6?d=identicon&s=25 unknown (Guest)
on 2006-01-10 02: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

E48d29dc8fedb2878fa518d41cc63d88?d=identicon&s=25 Jan Prill (Guest)
on 2006-01-10 10: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.