app / models / product.rb
class Product < ApplicationRecord
def methode1.1
# Do something
end
def method1
# Do something
methode1.1
end
def self.method2
# Do something
method1
end
end
在控制器中
def Method_4
# Do something
Product.method2
# Do something
end
我从控制器呼叫method2
。当我运行程序时。我遇到错误:
undefined local variable or method methode1 '' for class