instance method asset_integrity

Ruby on Rails 1.2.1

Since v1.2.1 Last seen in v1.3.2

Available in: v1.2.1 v1.3.2

Signature

asset_integrity(path, options = {})

Computes the Subresource Integrity (SRI) hash for the given asset path.

This method generates a cryptographic hash of the asset content that can be used to verify the integrity of the resource when it’s loaded by the browser.

asset_integrity("application.css")
# => "sha256-xyz789abcdef..."

Parameters

path req
options opt = {}
Source
# File lib/propshaft/helper.rb, line 43
    def asset_integrity(path, options = {})
      path = _path_with_extname(path, options)
      Rails.application.assets.resolver.integrity(path)
    end

Defined in lib/propshaft/helper.rb line 43 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Propshaft::Helper

Type at least 2 characters to search.

↑↓ navigate · open · esc close