Class: ThinkFeelDoEngine::ApplicationController
Overview
Site-wide controller superclass. Inherits from host’s ApplicationController.
Direct Known Subclasses
BitMaker::ContentModulesController, BitMaker::ContentProvidersController, BitMaker::SlidesController, BitMaker::SlideshowAnchorsController, BitMaker::SlideshowsController, Coach::GroupDashboardController, Coach::MembershipsController, Coach::MessagesController, Coach::ParticipantActivitiesVisualizationsController, Coach::ParticipantThoughtsVisualizationsController, Coach::PatientDashboardsController, Coach::PhqAssessmentsController, Coach::ReceivedMessagesController, Coach::SentMessagesController, Coach::SiteMessagesController, CoachDashboardController, KeepAliveController, LessonSlidesController, LessonsController, Manage::GroupsController, Manage::TasksController, MembershipsController, NavigatorController, ParticipantDataController, Participants::ActivitiesController, Participants::AssessmentsController, Participants::LessonsController, Participants::MediaAccessEventsController, Participants::PublicSlidesController, Participants::ThoughtsController, PasswordEntropyBitsController, PrivacyPoliciesController, QuickSignInsController
Constant Summary
collapse
- CSRF_COOKIE_NAME =
"XSRF-TOKEN"
"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_path ⇒ Object
47
48
49
50
51
52
53
|
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 47
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 26
def after_sign_in_path_for(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
41
42
43
44
45
|
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 41
def after_sign_out_path_for(resource)
session[:previous_url] || (
resource == :participant ? main_app.root_path : new_user_session_path
)
end
|
#raise_not_found! ⇒ Object
Called by last route matching unmatched routes. Raises an exception that is expected to be rescued.
65
66
67
68
|
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 65
def raise_not_found!
raise ActionController::RoutingError,
"No route matches #{params[:unmatched_route]}"
end
|
#render_not_found(_) ⇒ Object
70
71
72
|
# File 'app/controllers/think_feel_do_engine/application_controller.rb', line 70
def render_not_found(_)
render file: "#{Rails.root}/public/404.html", status: 404
end
|