mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-12 00:09:32 +00:00
Added a default redirect when updating a match
This commit is contained in:
@@ -27,7 +27,11 @@ class MatchesController < ApplicationController
|
|||||||
def update
|
def update
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @match.update(match_params)
|
if @match.update(match_params)
|
||||||
format.html { redirect_to params[:match][:redirect_path], notice: 'Match was successfully updated.' }
|
if params[:match][:redirect_path]
|
||||||
|
format.html { redirect_to params[:match][:redirect_path], notice: 'Match was successfully updated.' }
|
||||||
|
else
|
||||||
|
format.html { redirect_to "/tournaments/#{@match.tournament.id}", notice: 'Match was successfully updated.' }
|
||||||
|
end
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
format.html { render action: 'edit' }
|
format.html { render action: 'edit' }
|
||||||
|
|||||||
Reference in New Issue
Block a user