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.
 
 
 
 

26 lines
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