1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 07:09:39 +02:00

feat: add settings page (#274)

* feat: add settings page

* feat: add updating family name

* fix: formatting

* refactor: update to use Rails label helper
This commit is contained in:
Edrick Leong 2024-02-05 22:19:23 +08:00 committed by GitHub
parent f6251407e9
commit 622fc07a76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,21 @@
class SettingsController < ApplicationController
before_action :authenticate_user!
def edit
end
def update
if Current.user.update(user_params)
redirect_to root_path, notice: "Profile updated successfully."
else
render :edit, status: :unprocessable_entity
end
end
private
def user_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation,
family_attributes: [ :name, :id ])
end
end