From 52d46329e525133077b4f116c9e608128d8ba982 Mon Sep 17 00:00:00 2001 From: David Gay Date: Tue, 31 Oct 2023 01:15:04 -0400 Subject: Users#edit --- app/controllers/users_controller.rb | 5 ++--- app/views/home/index.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/runs/index.html.erb | 2 +- app/views/runs/show.html.erb | 2 +- app/views/users/edit.html.erb | 21 +++++++++++++++++++++ app/views/users/show.html.erb | 6 +++++- 7 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 app/views/users/edit.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f411ace..20ae049 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -7,9 +7,8 @@ class UsersController < ApplicationController def edit; end def update - @user.set(user_params) - if @user.save - redirect_to run_path(@run), notice: "Saved profile." + if @user.update(user_params) + redirect_to user_path(@user), notice: "Saved trainer card." else render :edit, status: :unprocessable_entity end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 0d693f1..457200c 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -7,7 +7,7 @@