mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
22 lines
508 B
Ruby
22 lines
508 B
Ruby
|
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
|