Extending controllers of a Rails 3 Engine in the main app

后端 未结 7 915
执念已碎
执念已碎 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:11

    @cowboycoded method 2 in conjunction with require_dependency and config.reload_plugins worked for me on Rails 3.2.2 / Ruby 1.9.

    Here is the code: https://stackoverflow.com/a/9790497/22237

提交回复
热议问题