用于#的未定义方法`question_answer'

时间:2013-12-23 12:01:06

标签: ruby-on-rails ruby-on-rails-3 mongoid

这是我的两个模特

class Answer
  include Mongoid::Document

  belongs_to :question
  has_many :responses
  has_many :validations, :dependent => :delete
end

class Question
  include Mongoid::Document

  has_many :answers, :dependent => :delete # it might not always have answers
  belongs_to :correct_answer, :class_name => "Answer", :dependent => :delete
end

这里缺少什么?无法解决它

0 个答案:

没有答案