Class: StompBase::SettingsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/stomp_base/settings_controller.rb

Instance Method Summary collapse

Methods included from I18nHelper

#available_locales, #current_locale, #locale_name, #t

Instance Method Details

#indexObject



8
9
10
# File 'app/controllers/stomp_base/settings_controller.rb', line 8

def index
  # Display settings screen
end

#updateObject



12
13
14
15
16
17
18
# File 'app/controllers/stomp_base/settings_controller.rb', line 12

def update
  update_locale_setting(params[:locale]) if params[:locale]

  update_theme_setting(params[:theme]) if params[:theme]

  safe_redirect_with_notice(t("stomp_base.settings.settings_updated"))
end

#update_localeObject



20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/stomp_base/settings_controller.rb', line 20

def update_locale
  locale = params[:locale]

  if valid_locale?(locale)
    update_user_locale(locale)
    render_success_response(locale)
  else
    render_error_response
  end
end