1 class ProfilesController < 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]
15 if params[:user][:description] != current_user.description
16 current_user.description = params[:user][:description]
17 current_user.description_format = "markdown"
20 case params[:avatar_action]
22 current_user.avatar.attach(params[:user][:avatar])
23 current_user.image_use_gravatar = false
25 current_user.avatar.purge_later
26 current_user.image_use_gravatar = false
28 current_user.avatar.purge_later
29 current_user.image_use_gravatar = true
32 current_user.home_lat = params[:user][:home_lat]
33 current_user.home_lon = params[:user][:home_lon]
36 flash[:notice] = t ".success"
37 redirect_to user_path(current_user)
39 flash.now[:error] = t ".failure"