Sha256: d93dbaf30bab6e91748f9c404256ff9c3ed5ecfa9755de713e966c0d804ffac8
Contents?: true
Size: 957 Bytes
Versions: 9
Compression:
Stored size: 957 Bytes
Contents
# frozen_string_literal: true module Lcms module Engine module PathHelper include Rails.application.routes.url_helpers def dynamic_path(path, *args) host_engine_path(path, *args).presence || main_app.send(path.to_sym, *args) end def dynamic_document_path(*args) host_engine_path(:document_path, *args).presence || main_app.document_path(*args) end def dynamic_material_path(*args) host_engine_path(:material_path, *args).presence || main_app.material_path(*args) end private def host_engine_path(key, *args) settings = Lcms::Engine::Admin::AdminController.settings if (host_route = settings.dig(:redirect, :host, key)).present? main_app.send(host_route.to_sym, *args) elsif (engine_route = settings.dig(:redirect, :engine, key)).present? lcms_engine.send(engine_route.to_sym, *args) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems