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
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
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 Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern. .
rails - in contrast to many other open source projects - is very well
documented. I suggest you work through some of these!
Regards
Jan
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs