0
我需要訪問params
,它位於模塊中,位於模塊幫助中。例如。Rails如何訪問模塊中的「params」方法,它位於輔助模塊內部
module ApplicationHelper
module ExampleModule
extend self
def an_example_method
//access params here
end
end
end
如何做到這一點?
如果你使用它,你就需要將PARAMS傳遞到方法的單。更好的問題是,你爲什麼試圖做到這一點。 – max
我不會用作單身人士。我希望在控制器中使用該方法作爲完全限定的名稱,就像「ExampleModule.an_example_method」一樣。 – rplaurindo