Module: Lcms::Engine::Admin::ConfigurableAdmin

Defined in:
app/controllers/lcms/engine/admin/configurable_admin.rb

Instance Method Summary collapse

Instance Method Details

#document_path(*args) ⇒ Object



11
12
13
# File 'app/controllers/lcms/engine/admin/configurable_admin.rb', line 11

def document_path(*args)
  @document_path ||= host_engine_path(:document_path, args) || super
end

#engine_klassObject



7
8
9
# File 'app/controllers/lcms/engine/admin/configurable_admin.rb', line 7

def engine_klass
  @engine_klass ||= settings[:engine].constantize
end

#host_engine_path(key, *args) ⇒ Object



23
24
25
26
27
28
29
# File 'app/controllers/lcms/engine/admin/configurable_admin.rb', line 23

def host_engine_path(key, *args)
  if (host_route = settings&.[](:redirect)&.[](:host)&.[](key)).present?
    Rails.application.routes.url_helpers.send(host_route, args)
  elsif (engine_route = settings&.[](:redirect)&.[](:engine)&.[](key)).present?
    engine_klass.routes.url_helpers.send(engine_route, args)
  end
end

#material_path(*args) ⇒ Object



15
16
17
# File 'app/controllers/lcms/engine/admin/configurable_admin.rb', line 15

def material_path(*args)
  @material_path ||= host_engine_path(:material_path, args) || super
end

#root_pathObject



19
20
21
# File 'app/controllers/lcms/engine/admin/configurable_admin.rb', line 19

def root_path
  @root_path ||= host_engine_path(:root_path) || explore_curriculum_index_path
end

#whoamiObject



31
32
33
# File 'app/controllers/lcms/engine/admin/configurable_admin.rb', line 31

def whoami
  render text: "stack=#{ENV['CLOUD66_STACK_NAME']}<br/>env=#{ENV['CLOUD66_STACK_ENVIRONMENT']}"
end