Your question is a bit vague. It seems like you have a relationship where a city has many people. If so, then you can assign the relationship like this:
city.people << person
or this
person.city_id = city.id
person.save
This method requires save
since assigning the city_id
to person
does not write the change to the database.
You can try these out in your rails console