diff --git a/app/controllers/users/account_controller.rb b/app/controllers/users/account_controller.rb index ce617f836..96511c77a 100644 --- a/app/controllers/users/account_controller.rb +++ b/app/controllers/users/account_controller.rb @@ -1,4 +1,10 @@ class Users::AccountController < ApplicationController def index; end def personal_details; end + + def update + if current_user.update('name': params[:user][:name], 'email': params[:user][:email],) + redirect_to(users_account_path()) + end + end end \ No newline at end of file diff --git a/app/helpers/account_helper.rb b/app/helpers/account_helper.rb new file mode 100644 index 000000000..ae6f5fe75 --- /dev/null +++ b/app/helpers/account_helper.rb @@ -0,0 +1,14 @@ +module AccountHelper + def resource_name + :user + end + + def resource + @resource = current_user + end + + def devise_mapping + @devise_mapping ||= Devise.mappings[:user] + end +end + \ No newline at end of file diff --git a/app/views/users/account/index.html.erb b/app/views/users/account/index.html.erb index 37a4560de..90d07e690 100644 --- a/app/views/users/account/index.html.erb +++ b/app/views/users/account/index.html.erb @@ -12,6 +12,7 @@ Name