]> git.openstreetmap.org Git - rails.git/blob - app/controllers/profiles/profile_sections_controller.rb
Merge pull request #5932 from tomhughes/frozen-strings
[rails.git] / app / controllers / profiles / profile_sections_controller.rb
1 # frozen_string_literal: true
2
3 module Profiles
4   class ProfileSectionsController < ApplicationController
5     layout :site_layout
6
7     before_action :authorize_web
8     before_action :set_locale
9
10     authorize_resource :class => :profile
11
12     before_action :check_database_readable
13     before_action :check_database_writable, :only => [:update]
14
15     def show; end
16
17     def update
18       if update_profile
19         flash[:notice] = t ".success"
20         redirect_to user_path(current_user)
21       else
22         flash.now[:error] = t ".failure"
23         render :show
24       end
25     end
26   end
27 end