Class: ThinkFeelDoEngine::ApplicationController

Inherits:
ApplicationController
  • Object
show all
Includes:
Concerns::BrowserDetective
Defined in:
app/controllers/think_feel_do_engine/application_controller.rb

Overview

Site-wide controller superclass. Inherits from host’s ApplicationController.

Constant Summary collapse

"XSRF-TOKEN"
CSRF_HEADER_NAME =
"X-XSRF-TOKEN"
ROOT_URI =
"/"
INACTIVE_MESSAGE =
"We're sorry, but you can't sign in yet "\
"because you are not assigned to an active group."

Instance Method Summary collapse

Instance Method Details

#access_denied_resource_pathObject



43
44
45
46
47
48
49
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 43

def access_denied_resource_path
  if defined?(think_feel_do_dashboard)
    think_feel_do_dashboard.root_path
  else
    privacy_policy_path
  end
end

#after_sign_in_path_for(resource) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 22

def (resource)
  if resource.class == User
    if defined?(think_feel_do_dashboard)
      think_feel_do_dashboard.root_path
    else
      privacy_policy_path
    end

  else
    super resource
  end
rescue ActionController::UrlGenerationError
  ROOT_URI
end

#after_sign_out_path_for(resource) ⇒ Object



37
38
39
40
41
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 37

def after_sign_out_path_for(resource)
  session[:previous_url] || (
    resource == :participant ? main_app.root_path : new_user_session_path
  )
end