The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 line
679 B

  1. # frozen_string_literal: true
  2. class Settings::ProfilesController < ApplicationController
  3. include ObfuscateFilename
  4. layout 'admin'
  5. before_action :authenticate_user!
  6. before_action :set_account
  7. obfuscate_filename [:account, :avatar]
  8. obfuscate_filename [:account, :header]
  9. def show; end
  10. def update
  11. if @account.update(account_params)
  12. redirect_to settings_profile_path, notice: I18n.t('generic.changes_saved_msg')
  13. else
  14. render action: :show
  15. end
  16. end
  17. private
  18. def account_params
  19. params.require(:account).permit(:display_name, :note, :avatar, :header, :locked)
  20. end
  21. def set_account
  22. @account = current_user.account
  23. end
  24. end