Class: Decidim::LocalesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Decidim::LocalesController
- Defined in:
- app/controllers/decidim/locales_controller.rb
Overview
A controller to allow users switching their locale.
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/controllers/decidim/locales_controller.rb', line 9 def create if current_user && params["locale"] && available_locales.include?(params["locale"]) current_user.update_attribute(:locale, params["locale"]) end redirect_to referer_with_new_locale end |