Circular dependency detected while autoloading constant (Rails 4, Ruby 2)
问题 configs/routes.rb Shutters and Paints are subresources of Jobs . resources :jobs do resources :shutters resources :paints end app/models/job.rb A Job contains many Shutters and many Paints . class Job < ActiveRecord::Base has_many :shutters, dependent: :delete_all has_many :paints, dependent: :delete_all accepts_nested_attributes_for :shutters, allow_destroy: true, :reject_if => lambda { |a| a[:no].blank? } accepts_nested_attributes_for :paints, allow_destroy: true, :reject_if => lambda { |a|