Class: Decidim::LocalesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/decidim/locales_controller.rb

Overview

A controller to allow users switching their locale.

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
# File 'app/controllers/decidim/locales_controller.rb', line 10

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