Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using Bootstrap from CDN requires an exact version number that is not tied to gem releases. Although historically
Bootstrap::VERSION
has mirrored the official Bootstrap version number, this might not always be the case. Therefore, this patch addsBootstrap::VENDOR_VERSION
, which is updated by the updater task.Additionally, it is best practice to employ subresource integrity hashes when using any public CDN. To support this, this patch adds
Bootstrap::VENDOR_INTEGRITY
, which is a Hash mapping asset names to their properly-encoded integrity hashes. This Hash is also updated by the updater task.Here is an example of usage:
It would be nice to wrap that up in a helper method like
<%= Bootstrap.js_cdn_tag(bundle: true) %>
, but I wasn't sure if that would be considered outside the scope of this gem. It would endorse a specific CDN, but perhaps that's acceptable, since it is the official Bootstrap CDN. Also, the helper method should probably include something akin to.try(:html_safe)
, which might feel out of place.Either way, I can add mention of this to the README, if desired.