1
我在我的ApplicationController
中定義了一些輔助方法。對於性能問題,我有一個用於/search
路由的Rack應用程序,我需要在此Rack中使用其中的一些方法。我現在無法將他們移動到圖書館或其他地方。Rails:在Rack應用程序中加載helper_method方法?
簡單例子:
class ApplicationController < ActionController::Base
helper_method :user_participants
...
end
而且在機架:
class SearchRack
def self.call(env)
# need to call user_participants here
end
end
我能做些什麼?
感謝,