Class | Jammit::Controller |
In: |
lib/jammit/controller.rb
|
Parent: | ActionController::Base |
The JammitController is added to your Rails application when the Gem is loaded. It takes responsibility for /assets, and dynamically packages any missing or uncached asset packages.
VALID_FORMATS | = | [:css, :js] |
SUFFIX_STRIPPER | = | /-(datauri|mhtml)\Z/ |
NOT_FOUND_PATH | = | "#{Jammit.public_root}/404.html" |
Tells the Jammit::Packager to cache and gzip an asset package. We can‘t just use the built-in "cache_page" because we need to ensure that the timestamp that ends up in the MHTML is also on the cached file.
If we‘re generating MHTML/CSS, return a stylesheet with the absolute request URL to the client, and cache a version with the timestamped cache URL swapped in.
Extracts the package name, extension (:css, :js), and variant (:datauri, :mhtml) from the incoming URL.