Add a simple edit control for the user's preferred languages.
[rails.git] / app / controllers / user_controller.rb
index 2050ffdb4506056bbb39811ba34fd745ad6b8402..9c2787cc84c6002359775c9dde2c0b198d65a9e8 100644 (file)
@@ -50,10 +50,13 @@ class UserController < ApplicationController
       end
 
       @user.description = params[:user][:description]
+      @user.languages = params[:user][:languages].split(",")
       @user.home_lat = params[:user][:home_lat]
       @user.home_lon = params[:user][:home_lon]
 
       if @user.save
+        set_locale
+
         if params[:user][:email] == @user.new_email
           flash[:notice] = I18n.t('user.account.flash update success confirm needed')
           Notifier.deliver_email_confirm(@user, @user.tokens.create)