Class: Lato::ApplicationController
Instance Method Summary
collapse
#lato_index_collection
Methods included from Layoutable
#active_navbar, #active_sidebar, #hide_sidebar, #page_class, #page_classes, #page_title, #show_sidebar
#authenticate_session, #limit_requests, #not_authenticate_session, #session_create, #session_destroy
Instance Method Details
#error ⇒ Object
25
26
27
|
# File 'app/controllers/lato/application_controller.rb', line 25
def error
respond_to_with_error
end
|
#index ⇒ Object
12
13
14
15
|
# File 'app/controllers/lato/application_controller.rb', line 12
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
|
#not_found ⇒ Object
21
22
23
|
# File 'app/controllers/lato/application_controller.rb', line 21
def not_found
respond_to_with_not_found
end
|
#offline ⇒ Object
17
18
19
|
# File 'app/controllers/lato/application_controller.rb', line 17
def offline
respond_to_with_offline
end
|
#switch_locale ⇒ Object
29
30
31
32
33
|
# File 'app/controllers/lato/application_controller.rb', line 29
def switch_locale
I18n.locale = params[:locale]
@session.user.update(locale: params[:locale]) if @session.valid?
respond_to_redirect_same_page
end
|