Class: Qbrick::Cms::BackendController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Qbrick::Cms::BackendController
show all
- Defined in:
- app/controllers/qbrick/cms/backend_controller.rb
Instance Method Summary
collapse
Instance Method Details
#default_url_options ⇒ Object
29
30
31
|
# File 'app/controllers/qbrick/cms/backend_controller.rb', line 29
def default_url_options
{ content_locale: I18n.locale }.merge(super)
end
|
#reset_remembered_locale ⇒ Object
23
24
25
26
27
|
# File 'app/controllers/qbrick/cms/backend_controller.rb', line 23
def reset_remembered_locale
return if session['remembered_locale'].blank?
I18n.locale = session.delete 'remembered_locale'
end
|
#set_content_locale ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/qbrick/cms/backend_controller.rb', line 9
def set_content_locale
new_locale = params[:content_locale] || session['backend_locale'] || I18n.locale
session['backend_locale'] = new_locale.to_s
return if I18n.locale == new_locale || !I18n.locale_available?(new_locale)
session['remembered_locale'] = I18n.locale
I18n.locale = new_locale
end
|