Ruby on Rails委托抛出未定义的方法错误

时间:2017-05-26 22:04:18

标签: ruby-on-rails

我有个人资料模型:

 # Experience
  has_many :experiences, dependent: :destroy
   accepts_nested_attributes_for :experiences, allow_destroy: true
  delegate :incomplete, to: :experiences, prefix: true

经验模型:

  belongs_to :profile
  def incomplete
    true
  end

但是当我从控制器执行@profile.experiences_incomplete时,它会给我这个错误:

undefined method `incomplete' for #< Experience::ActiveRecord_Associations_CollectionProxy:0x00000004600938>

0 个答案:

没有答案