I have been (hours) trouble with associations in Rails. I found a lot of similar problems, but I couldn\'t apply for my case:
City\'s class:
class Ci
Rails.application.config.active_record.belongs_to_required_by_default = false
This works because the Rails 5 has true by default to disable you go under Initilizers then click on the New_frame-work and turn the true to false