I am trying to use Jammit to pack CSS and JS for a Rails application deployed to Heroku that doesn’t work because of the box due to Heroku read-only file system. Each example that I saw on how to do this recommends creating all the packed files in advance. Due to the deployment based on Heroku Git, this means that you need to make a separate commit in your repository each time these files change, which is not an acceptable solution for me. Instead, I want to change the path that Jammit uses to write cached packets to #{Rails.root}/tmp/assets(by changing ActionController::Base#page_cache_directory) which is writable on Heroku.
What I don't understand is how cached files will be used without using the Rails stack every time, even using the default path for cached packages. Let me explain what I mean:
When you include a package using the Jammit helper, it looks something like this:
<%= include_javascripts :application %>
which generates this script tag:
<script src="/assets/application.js" type="text/javascript"></script>
URL-, Jammit::Controller#package, , #{page_cache_directory}/assets/application.js. , , , Rails. Jammit, , . /assets/application.js Jammit::Controller ?
, Rack - , , , , . , ? ActionController::Base#page_cache_directory ( , Jammit )? #{Rails.root}/tmp , URL-, .