From 0599faa1738839d13884e169966f4c5bae13efb6 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Thu, 24 Jan 2019 14:13:22 +0000 Subject: [PATCH] Updated messages for actions that will require extra steps. --- app/controllers/wrestlers_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/wrestlers_controller.rb b/app/controllers/wrestlers_controller.rb index d47dd72..9493c0f 100644 --- a/app/controllers/wrestlers_controller.rb +++ b/app/controllers/wrestlers_controller.rb @@ -86,8 +86,9 @@ class WrestlersController < ApplicationController if params[:wrestler]['pool'] @wrestler.pool = params[:wrestler]['pool'] respond_to do |format| + message = "Wrestler has successfully been switched to a new pool. Matches for that weight are now in a weird state. Please re-generate matches when you are done with all of your changes." if @wrestler.update(wrestler_params) - format.html { redirect_to "/weights/#{@wrestler.weight.id}/", notice: 'Wrestler was successfully updated. Please re-generate this weight classes matches.' } + format.html { redirect_to "/tournaments/#{@tournament.id}/brackets/#{@wrestler.weight.id}/", notice: message } format.json { head :no_content } else format.html { render action: 'edit' } @@ -103,10 +104,11 @@ class WrestlersController < ApplicationController @school = @wrestler.school @wrestler.destroy respond_to do |format| + message = "Wrestler was successfully deleted. This action has removed all matches. Please re-generate matches if you already had matches." if session[:return_path] - format.html { redirect_to session.delete(:return_path), notice: 'Wrestler was successfully deleted.' } + format.html { redirect_to session.delete(:return_path), notice: message } else - format.html { redirect_to @school, notice: 'Wrestler was successfully deleted.' } + format.html { redirect_to @school, notice: message } format.json { head :no_content } end end