The code powering m.abunchtell.com https://m.abunchtell.com
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

26 行
447 B

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