我得到這個錯誤「未定義的方法`attribute_method_matcher'爲零:NilClass」。未定義的方法`attribute_method_matcher'爲零:NilClass
我的控制器名稱爲計算機輔助設計它的功能是
def index
@cadempty = Cad.new
@caddata = Cad.all
end
的錯誤是在創建新的對象。如果我評論Cad.new
代碼工作正常。
早些時候我認爲這可能是因爲我有一個名爲'new'的方法,並且我使用User.new
爲表單創建空白對象。但它並不是我將該方法重命名爲其他錯誤的錯誤,並且錯誤仍然存在。我不知道我在做什麼錯。
可能重複:http://stackoverflow.com/questions/12414297/how-do-i-analyze-the-source-of-the-undefined-method-attribute-method-matcher –