Use a helper to avoid using media/
asset prefixes (#28756)
This commit is contained in:
parent
baab58c80b
commit
cb5ac15923
31 changed files with 40 additions and 36 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
module MascotHelper
|
||||
def mascot_url
|
||||
full_asset_url(instance_presenter.mascot&.file&.url || asset_pack_path('media/images/elephant_ui_plane.svg'))
|
||||
full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg'))
|
||||
end
|
||||
|
||||
def instance_presenter
|
||||
|
|
|
@ -24,8 +24,12 @@ module RoutingHelper
|
|||
Rails.configuration.action_controller.asset_host || root_url
|
||||
end
|
||||
|
||||
def full_pack_url(source, **options)
|
||||
full_asset_url(asset_pack_path(source, **options))
|
||||
def frontend_asset_path(source, **options)
|
||||
asset_pack_path("media/#{source}", **options)
|
||||
end
|
||||
|
||||
def frontend_asset_url(source, **options)
|
||||
full_asset_url(frontend_asset_path(source, **options))
|
||||
end
|
||||
|
||||
def use_storage?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue