I know it sounds kinda nuts, but I'm building an engine that will power and tie several applications, and since all applications will use a given plugin, I was wondering whether I could just put the plugin in the engine.
So I put it inside vendor/plugins, but it appears it isn't loaded.
I've been playing with autoload_paths
and require
, but I haven't been successful.
Does anyone know if this is possible? Or do you have an idea on what I might try?
Thanks!
After some fiddling, this is what I found works and seems correct:
module MyEngine
class Engine < Rails::Engine
config.after_initialize do
Rails.application.config.paths.vendor.plugins.push File.expand_path('../../vendor/plugins', __FILE__)
end
end
end
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