I
I
IvanN7772017-08-14 21:43:15
Ruby on Rails
IvanN777, 2017-08-14 21:43:15

Rails Engine, if config.eager_load = false, then gem doesn't load controllers, how to fix it?

If config.eager_load = false
The first thing I thought about was
config.autoload_paths

class Engine < ::Rails::Engine
    isolate_namespace TrueandcoAnalytics

    config.autoload_paths += Dir["#{config.root}/app/**/*.rb"]

But it seems that he did not load the controllers from the engine.
This is only needed for dev mode.
So-as in the prod config.eager_load = true
Thanks for the answers.
Who needs the "self-written traffic analytics" gem, write, implemented on Ajax, and then on web sockets.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Ponomarev, 2017-10-14
@ilyario

routes.rb spelled out?

mount TrueandcoAnalytics::Engine => '/path'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question