Rails 3.1: Better way to expose an engine's helper within the client app

后端 未结 5 1874
夕颜
夕颜 2020-12-08 10:22

I have found a few articles addressing the issue of helpers within an engine not being accessible to the consuming (parent) application. To make sure we are all on the same

5条回答
  •  暖寄归人
    2020-12-08 11:05

    module YourEngine
      module Helpers
        def a_helper
        end
    
        ...
      end
    end
    
    ActionController::Base.send(:helper, YourEngine::Helpers)
    

提交回复
热议问题