Validation failed Class must exist

后端 未结 8 1515
面向向阳花
面向向阳花 2020-12-13 17:30

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         


        
8条回答
  •  别那么骄傲
    2020-12-13 17:57

    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

提交回复
热议问题