闭社主体 forked from https://github.com/tootsuite/mastodon
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.

29 lines
558 B

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