A
A
Anton Ivanov2017-11-10 23:58:12
Ruby on Rails
Anton Ivanov, 2017-11-10 23:58:12

How to get rid of the problem when eager loading the lib directory and using custom controller templates?

Hello.
In production I use eager load for the entire lib directory

config.eager_load_paths += Dir["#{config.root}/lib/"]

It also uses a custom controller scaffold generator, which has the lib/templates/erb/controller.rb
problem that it is, in fact, an erb file. But with .rb extension. The rails try to load it and break off, the server does not start.
The question is how to solve this situation. One solution is not to add libto eager_load_pathsand load everything manually, but maybe there is another solution?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vsuhachev, 2017-11-21
@Fly3110

Don't dump `lib/templates` to production, as well as `app/assets`, `test` and other unnecessary things?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question