Module: Optimacms::Devise::Controller

Extended by:
ActiveSupport::Concern
Included in:
ConfirmationsController, PasswordsController, RegistrationsController, SessionsController, UnlocksController
Defined in:
lib/optimacms/devise.rb

Overview

got from activeadmin

Instance Method Summary collapse

Instance Method Details

#root_pathObject

Redirect to the default namespace on logout



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/optimacms/devise.rb', line 43

def root_path
  return '/'
  #namespace = Optimacms.application.default_namespace.presence
  namespace = nil
  root_path_method = [namespace, :root_path].compact.join('_')

  path = if Helpers::Routes.respond_to? root_path_method
           Helpers::Routes.send root_path_method
         else
           # Guess a root_path when url_helpers not helpful
           "/#{namespace}"
         end

  # NOTE: `relative_url_root` is deprecated by rails.
  #       Remove prefix here if it is removed completely.
  #prefix = Rails.configuration.action_controller[:relative_url_root] || ''
  prefix = ''
  prefix + path
end