i'm using a Rails engine, but i need to customize some controllers actions.
I actually forked the engine, and implementing those customizations into my own fork, but i was wondering if there is an official way in Rails Engines to override and customize controllers.
Just define a controller with the same name in your own app\controllers
folder, and it will be found first.
That way you can easily customize it.
Please note: because it is found first, you replace the entire controller from the engine. This could be exactly what you want. In some cases, you just want to adjust a little, then it is much better to reopen the class, and only redefine what is needed.
Examples to do is can be found here: http://edgeguides.rubyonrails.org/engines.html#overriding-models-and-controllers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With