1 class PreferencesController < ApplicationController
4 before_action :authorize_web
5 before_action :set_locale
7 authorize_resource :class => false
9 before_action :check_database_readable
10 before_action :check_database_writable, :only => [:update]
17 current_user.languages = params[:user][:languages].split(",")
19 current_user.preferred_editor = if params[:user][:preferred_editor] == "default"
22 params[:user][:preferred_editor]
25 # Use a partial so that it is rendered during the next page load in the correct language.
26 flash[:notice] = { :partial => "preferences/update_success_flash" }
27 redirect_to preferences_path
29 flash[:error] = t ".failure"