Class: Lato::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Lato::ApplicationController
- Includes:
- Componentable, Layoutable, Sessionable
- Defined in:
- app/controllers/lato/application_controller.rb
Direct Known Subclasses
AccountController, AuthenticationController, OperationsController
Instance Method Summary collapse
Methods included from Componentable
Methods included from Layoutable
#active_navbar, #active_sidebar, #hide_sidebar, #show_sidebar
Methods included from Sessionable
#authenticate_session, #limit_requests, #not_authenticate_session, #session_create, #session_destroy
Instance Method Details
#index ⇒ Object
10 11 12 13 |
# File 'app/controllers/lato/application_controller.rb', line 10 def index session_root_path = Lato.config.session_root_path ? main_app.send(Lato.config.session_root_path) : lato.account_path redirect_to @session.valid? ? session_root_path : lato.authentication_signin_path end |
#switch_locale ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/lato/application_controller.rb', line 15 def switch_locale I18n.locale = params[:locale] @session.user.update(locale: params[:locale]) if @session.valid? respond_to_redirect_same_page end |