Module: Panda::Core::AssetHelper
- Defined in:
- app/helpers/panda/core/asset_helper.rb
Instance Method Summary collapse
-
#panda_core_assets ⇒ Object
Include Panda Core JavaScript and CSS assets.
-
#panda_core_importmap_tag ⇒ Object
The
Include Panda Core JavaScript and CSS assets
7 8 9
# File 'app/helpers/panda/core/asset_helper.rb', line 7 def panda_core_assets Panda::Core::AssetLoader..html_safe end
#panda_core_importmap_tag ⇒ Object
The
Include only Core JavaScript
This is the single entry point for all Panda JavaScript loading. It automatically includes JavaScript from Core and all registered modules via ModuleRegistry.
Note: Always uses importmap (Rails 8 approach), regardless of asset source
The tags are built by hand rather than through
javascript_importmap_tagsbecause the importmap is assembled from ModuleRegistry rather than from a Rails importmap. That means the nonce has to be applied by hand too: under a Content Security Policy ofscript-src 'self'an un-nonced inlineThe module entry-point
Include only Core CSS
66 67 68 69 70 71
# File 'app/helpers/panda/core/asset_helper.rb', line 66 def panda_core_stylesheet css_url = Panda::Core::AssetLoader.css_url return "" unless css_url stylesheet_link_tag(css_url) end