]> git.openstreetmap.org Git - rails.git/blob - app/controllers/profiles/descriptions_controller.rb
Move profile image editing to image page
[rails.git] / app / controllers / profiles / descriptions_controller.rb
1 module Profiles
2   class DescriptionsController < ProfileSectionsController
3     private
4
5     def update_profile
6       social_links_params = params.permit(:user => [:social_links_attributes => [:id, :url, :_destroy]])
7       current_user.assign_attributes(social_links_params[:user])
8
9       if params[:user][:description] != current_user.description
10         current_user.description = params[:user][:description]
11         current_user.description_format = "markdown"
12       end
13
14       current_user.save
15     end
16   end
17 end