1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-03 05:27:25 +00:00

Swap page is now working and also moved swaping logic from tournament model to its own class

This commit is contained in:
2016-01-27 14:13:49 +00:00
parent 96c7cd446c
commit a8b96c96e8
10 changed files with 80 additions and 73 deletions

View File

@@ -1,16 +1,9 @@
class WrestlersController < ApplicationController
before_action :set_wrestler, only: [:show, :edit, :update, :destroy, :swap]
before_action :set_wrestler, only: [:show, :edit, :update, :destroy]
before_filter :check_access, only: [:new,:create,:update,:destroy,:edit]
def swap
respond_to do |format|
if @wrestler.tournament.swapWrestlers(@wrestler.id, params[:wrestler][:swapId])
format.html { redirect_to @wrestler, notice: 'Wrestler was successfully swaped.' }
format.json { render action: 'show', status: :created, location: @wrestler }
end
end
end
# GET /wrestlers/1
# GET /wrestlers/1.json