Extending controllers of a Rails 3 Engine in the main app

后端 未结 7 949
执念已碎
执念已碎 2020-11-30 02:52

I am using a Rails engine as a gem in my app. The engine has PostsController with a number of methods and I would like to extend the controller logic in my main

7条回答
  •  臣服心动
    2020-11-30 03:25

    Why not just inherit from the Engine's controller class in your application (and point your routes at the new child controllers)? Sounds conceptually similar to the way that you extend built-in Devise controllers.

提交回复
热议问题