2   class PreferencesController < ApplicationController
 
   5     before_action :authorize_web
 
   6     before_action :set_locale
 
   8     authorize_resource :class => :preferences
 
  10     before_action :check_database_readable
 
  11     before_action :check_database_writable, :only => :update
 
  17         # Use a partial so that it is rendered during the next page load in the correct language.
 
  18         flash[:notice] = { :partial => "preferences/preferences/update_success_flash" }
 
  19         referer = safe_referer(params[:referer]) if params[:referer]
 
  20         redirect_to referer || { :action => :show }
 
  22         flash.now[:error] = t "failure", :scope => "preferences.preferences.update"