Skip to content
Larry Reid edited this page Jul 9, 2016 · 4 revisions

Welcome to the relationships wiki!

Here's how I built it.

[TODO: How did I do Address and Province?]

User

The User was initially created by:

rails g model User name:string

Person

The Person was initially created by:

rails g model Person name:string user:references

You then have to modify the person.rb file so that the belongs_to line looks like this:

  belongs_to :user, optional: true

Connect Person to Address

rails g model AddressPerson address:references person:references address_type:string
Clone this wiki locally