Rails engines extending functionality

前端 未结 6 766
夕颜
夕颜 2020-12-01 06:50

I have an engine which defines some models and controllers. I want to be able to extend functionality of some models/controllers in my application (eg. adding methods) witho

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 07:29

    require MyEngine::Engine.root.join('app', 'models', 'my_engine', 'my_model')
    

    before the model class definition in your application.

提交回复
热议问题