module Propshaft::Helper

Helper module that provides asset path resolution and integrity support for Rails applications.

This module extends Rails’ built-in asset helpers with additional functionality:

Subresource Integrity (SRI) Support

SRI helps protect against malicious modifications of assets by ensuring that resources fetched from CDNs or other sources haven’t been tampered with.

SRI is automatically enabled in secure contexts (HTTPS or local development) when the ‘integrity’ option is set to true:

<%= stylesheet_link_tag "application", integrity: true %>
<%= javascript_include_tag "application", integrity: true %>

This will generate integrity hashes and include them in the HTML:

<link rel="stylesheet" href="/assets/application-abc123.css"
      integrity="sha256-xyz789...">
<script src="/assets/application-def456.js"
        integrity="sha256-uvw012..."></script>

Bulk Stylesheet Inclusion

The stylesheet_link_tag helper supports special symbols for bulk inclusion: