Content
You are here:
[Solved] Patching/overriding existent OP view via plugin.
Added by Alexander Aleschenko 9 months ago
Hello
I'm trying to build simple plugin which changes app's controller and view. Controllers(and models) can be patched and it works ok, but there's problem with views. As I understand, rails looks up view file in app scope at first and if it not found tries to check view file in the engine(plugin).
Is there a way to completely override OP's view via plugin? Or, ideally, inject "render" inside erb at specific place without changing OP app itself?
Replies (3)
HI Alexander,
have you checked our proto_plugin? That should give you some hints as to how to inject your own views into the existing OpenProject ones where possible.
It shows only adding new views, not changing or replacing existing.
Looks like OpenProject::Plugins::ActsAsOpEngine#override_core_views! inside engine.rb does the job.