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:
parent
f6251407e9
commit
622fc07a76
6 changed files with 69 additions and 0 deletions
21
app/controllers/settings_controller.rb
Normal file
21
app/controllers/settings_controller.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue