I'm getting this error "undefined method `attribute_method_matcher' for nil:NilClass".
My controller name is Cad Its function is
def index
@cadempty = Cad.new
@caddata = Cad.all
end
The error is on creating the new object. If I comment Cad.new
the code works fine.
Earlier I thought it could be because I have a method named 'new' and I was Using User.new
to create a blank object for the form. But its not the error I renamed the method to something else and the error still exists. I have no idea what I'm doing wrong.