1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-03 21:33:48 +00:00

When deleting a wrestler from weights show page, it now redirects to weights show

This commit is contained in:
2019-01-24 13:44:53 +00:00
parent b15bdf6410
commit c721abe1f6
3 changed files with 38 additions and 8 deletions

View File

@@ -7,11 +7,14 @@ class WeightsController < ApplicationController
# GET /weights/1.json
def show
if params[:wrestler]
Wrestler.update(params[:wrestler].keys, params[:wrestler].values)
redirect_to @weight.tournament
respond_to do |format|
Wrestler.update(params[:wrestler].keys, params[:wrestler].values)
format.html { redirect_to @weight, notice: 'Seeds were successfully updated.' }
end
end
@wrestlers = @weight.wrestlers
@tournament = @weight.tournament
session[:return_path] = "/weights/#{@weight.id}"
end
# GET /weights/new