闭社主体 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.

27 lines
521 B

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