summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/matches_controller.rb36
1 files changed, 20 insertions, 16 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index ee68e11..5c654dd 100644
--- a/app/controllers/matches_controller.rb
+++ b/app/controllers/matches_controller.rb
@@ -3,22 +3,26 @@ class MatchesController < ApplicationController
# GET /matches
# GET /matches.json
- require 'httparty'
- require 'json'
- require 'delayed_job'
-
- def index
- @matches = @tournament.matches
- # width of SVG
- @width = 300 * (Math.log2(@matches.count).floor + 1);
- # height of SVG
- @height = 200 * 2**Math.log2(@matches.count).floor + 100;
- end
-
+ require 'httparty'
+ require 'json'
+ require 'delayed_job'
+
+ def index
+ @matches = @tournament.matches
+ # width of SVG
+ @width = 300 * (Math.log2(@matches.count).floor + 1);
+ # height of SVG
+ @height = 200 * 2**Math.log2(@matches.count).floor + 100;
+ end
+ # For compatability with the router assumptions made by ApplicationController#check_permission
+ def matches_url
+ set_tournament
+ tournament_matches_path(@tournament)
+ end
- def get_riot_info
- if signed_in?
+ def get_riot_info
+ if signed_in?
#current user information
response = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/summoner/by-name/#{current_user.user_name}?api_key=ad539f86-22fd-474d-9279-79a7a296ac38")
@@ -117,8 +121,8 @@ class MatchesController < ApplicationController
@purp = purple
@blue = blue
- end #end if
- end #end def
+ end #end if
+ end #end def
# GET /matches/1
# GET /matches/1.json