Module: Plutonium::Helpers::AssetsHelper
- Included in:
- UI::Layout::Base
- Defined in:
- lib/plutonium/helpers/assets_helper.rb
Overview
Helper module for managing asset-related functionality
Instance Method Summary collapse
-
#resource_favicon_asset ⇒ String
Get the favicon asset path.
-
#resource_favicon_tag ⇒ ActiveSupport::SafeBuffer
Generate a favicon link tag.
-
#resource_logo_asset ⇒ String
Get the logo asset path.
-
#resource_logo_tag(classname:) ⇒ ActiveSupport::SafeBuffer
Generate an image tag for the logo.
-
#resource_script_asset ⇒ String
Get the script asset path.
-
#resource_script_tag ⇒ ActiveSupport::SafeBuffer
Generate a script tag for the resource.
-
#resource_stylesheet_asset ⇒ String
Get the stylesheet asset path.
-
#resource_stylesheet_tag ⇒ ActiveSupport::SafeBuffer
Generate a stylesheet tag for the resource.
Instance Method Details
#resource_favicon_asset ⇒ String
Get the favicon asset path
62 63 64 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 62 def resource_favicon_asset Plutonium.configuration.assets.favicon end |
#resource_favicon_tag ⇒ ActiveSupport::SafeBuffer
Generate a favicon link tag
26 27 28 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 26 def resource_favicon_tag favicon_link_tag(resource_favicon_asset) end |
#resource_logo_asset ⇒ String
Get the logo asset path
41 42 43 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 41 def resource_logo_asset Plutonium.configuration.assets.logo end |
#resource_logo_tag(classname:) ⇒ ActiveSupport::SafeBuffer
Generate an image tag for the logo
34 35 36 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 34 def resource_logo_tag(classname:) image_tag(resource_logo_asset, class: classname) end |
#resource_script_asset ⇒ String
Get the script asset path
55 56 57 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 55 def resource_script_asset Plutonium.configuration.assets.script end |
#resource_script_tag ⇒ ActiveSupport::SafeBuffer
Generate a script tag for the resource
18 19 20 21 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 18 def resource_script_tag url = resource_asset_url_for(:js, resource_script_asset) javascript_include_tag(url, "data-turbo-track": "reload", type: "module") end |
#resource_stylesheet_asset ⇒ String
Get the stylesheet asset path
48 49 50 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 48 def resource_stylesheet_asset Plutonium.configuration.assets.stylesheet end |
#resource_stylesheet_tag ⇒ ActiveSupport::SafeBuffer
Generate a stylesheet tag for the resource
10 11 12 13 |
# File 'lib/plutonium/helpers/assets_helper.rb', line 10 def resource_stylesheet_tag url = resource_asset_url_for(:css, resource_stylesheet_asset) stylesheet_link_tag(url, "data-turbo-track": "reload") end |