2022-06-26 10:16:31 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Settings::ProfileController < ApplicationController
|
|
|
|
before_action :authenticate_user!
|
|
|
|
|
|
|
|
def edit; end
|
|
|
|
|
|
|
|
def update
|
2023-01-08 04:13:03 -08:00
|
|
|
profile_attributes = params.require(:profile).permit(:display_name, :motivation_header, :website, :location, :description, :anon_display_name, :allow_long_questions)
|
2022-06-26 10:16:31 -07:00
|
|
|
|
|
|
|
if current_user.profile.update(profile_attributes)
|
|
|
|
flash[:success] = t(".success")
|
|
|
|
else
|
|
|
|
flash[:error] = t(".error")
|
|
|
|
end
|
2022-06-26 10:45:31 -07:00
|
|
|
|
2023-10-19 17:21:52 -07:00
|
|
|
render :edit
|
2022-06-26 10:16:31 -07:00
|
|
|
end
|
|
|
|
end
|