1
在我的Rails應用程序我有一個模塊定義這樣一個模塊內重寫const_missing:的Rails:
module WhateverModule
class WhateverClass
...
end
end
此文件(whatever_class.rb)位於/應用程序/模型/ whatever_module
const_missing
正在被Rails覆蓋,儘管我做了一些解決方法,涉及初始化器,但我希望能夠以更好的方式實現它。
我的目標是得到一個WhateverModule :: Foo(Foo未定義),通過自定義的const_missing
方法來解決。
任何幫助將不勝感激。提前致謝!!