Forum: Ruby on Rails RE: Design Question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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

Thanks
Silvy
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 ]
end

and

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

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

Regards
Jan
This topic is locked and can not be replied to.