mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Matche edit and mat show redirect properly
This commit is contained in:
@@ -27,7 +27,7 @@ class MatchesController < ApplicationController
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @match.update(match_params)
|
||||
format.html { redirect_to mat_path(@match.mat_id), notice: 'Match was successfully updated.' }
|
||||
format.html { redirect_to params[:match][:redirect_path], notice: 'Match was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: 'edit' }
|
||||
@@ -45,7 +45,7 @@ class MatchesController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def match_params
|
||||
params.require(:match).permit(:w1, :w2, :w1_stat, :w2_stat, :winner_id, :win_type, :score, :finished)
|
||||
params.require(:match).permit(:w1, :w2, :w1_stat, :w2_stat, :winner_id, :win_type, :score, :finished, :redirect_path)
|
||||
end
|
||||
|
||||
def check_access
|
||||
|
||||
Reference in New Issue
Block a user