我得到这个错误“未定义的方法`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 –