diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 47e240865..a70195c9e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,7 +1,7 @@ class UsersController < ApplicationController require_unauthenticated_access only: %i[ new create ] - before_action :set_user, only: :show + before_action :set_user, only: %i[ show edit update ] before_action :set_account_from_join_code, only: %i[ new create ] def new @@ -17,6 +17,14 @@ class UsersController < ApplicationController def show end + def edit + end + + def update + @user.update user_params + redirect_to user_path(@user) + end + private def set_account_from_join_code @account = Account.find_by_join_code!(params[:join_code]) diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb new file mode 100644 index 000000000..bffe4052e --- /dev/null +++ b/app/views/users/edit.html.erb @@ -0,0 +1,46 @@ +<% @page_title = "Edit your profile" %> + +<% content_for :header do %> + +<% end %> + +