I've come across the most perplexing problem.
Using:
rails 4.1.7
slim 2.1.0
virtualbox: with application files mounted from hostos to guestos.
The problem happens to be that our application has gotten rather large, and re-loading all of the code for reach request is turning out to be very time consuming. Esp, for our front-end developers.
The core of the problem is:
config.cache_classes
If this is set to false, rails does NOT cache any of the classes and reloads them upon each request, good for developers, totally pointless for front-end developers as they are modifying only templates and css.
For the front-end developers, I want to set config.cache_classes = true.
Then, the slim template files are also cached.
When I reduce the code (hack and slash) until I had a presentable debuggable example the problem went away. Even though that config.cache_classes = true, the templates still RELOADED.
Thus it appears that:
- Large application + config.cache_classes(true) = templates do NOT reload
small application + config.cache_classes(true) = templates do reload
- Does anyone know how to force the slim templates and ONLY the slim templates to reload for reach request.
- OR: Reduce the amount of code reloaded, when config.cache_classes = false
My current thought is that slim is creating class for each file/template and that gets wiped in between requests, when rails reloads all of the classes. But, that doesn't bear out as true in the small test case application.
That's why.
Just set the values you want (true and false respectively) and here you go.
http://guides.rubyonrails.org/configuring.html#rails-general-configuration