1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-08 07:22:38 +00:00

Added shell views and routes to swap wrestlers bracket positions

Still need to set permssions on swap controller method
This commit is contained in:
2016-01-25 12:53:32 +00:00
parent 0275b48499
commit 75efa73777
4 changed files with 27 additions and 3 deletions

View File

@@ -1,8 +1,17 @@
class WrestlersController < ApplicationController
before_action :set_wrestler, only: [:show, :edit, :update, :destroy]
before_action :set_wrestler, only: [:show, :edit, :update, :destroy, :swap]
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
def show