ruby - Rails engine doesn't load mailer -
i'm working on engine inside app , creating mailer engine inside engines/my_engine/app/mailers
i'm getting uninitialized constant my_engine::ticketmailer
.
checking loaded paths doing puts $:
see rails loads assets, controllers, models , helpers inside app folder not mailers.
is there way fix , add path loaded?
i found solution problem. apparently mailers folder not loaded automatically can add folders load path manually adding line 1 engine.rb
:
paths['app/mailers'] << 'my_engine/app/mailers'
like this:
module my_engine class engine < ::rails::engine isolate_namespace my_engine paths['app/mailers'] << 'my_engine/app/mailers' end end
that fixed problem.
Comments
Post a Comment