Sha256: 2f1b998080c6bdfe9bb9e37e51c40e7d6183bd266228a3be8e4f9f634079d0e6
Contents?: true
Size: 872 Bytes
Versions: 19
Compression:
Stored size: 872 Bytes
Contents
module Enjoy::GzipHelper def gzip_javascript_include_tag(*sources) # Grab the asset html include tag tag = javascript_include_tag(*sources) # If we are in production and the requesting client accepts gzip encoding, swap for the gzip asset if Rails.env.production? && request.accept_encoding =~ /gzip/i tag = tag.gsub(/\.js/i, ".js.gz") end # Return the asset whether or not it was modified tag.html_safe end def gzip_stylesheet_link_tag(*sources) # Grab the asset html include tag tag = stylesheet_link_tag(*sources) # If we are in production and the requesting client accepts gzip encoding, swap for the gzip asset if Rails.env.production? && request.accept_encoding =~ /gzip/i tag = tag.gsub(/\.css/i, ".css.gz") end # Return the asset whether or not it was modified tag.html_safe end end
Version data entries
19 entries across 19 versions & 1 rubygems