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.
Maybe one of your column names in the database table is a reserved word.
Avoid using names for methods that are reserved words in the language.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With