summaryrefslogtreecommitdiff
path: root/app/controllers/matches_controller.rb
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-04-06 23:30:47 -0400
committerguntasgrewal <guntasgrewal@gmail.com>2014-04-06 23:30:47 -0400
commit3602d46e95f9a13ec2a8ff0b0909059af64c55ba (patch)
tree1dbf1149e8f6915f0c07b7a9aef1bf790a7b41c5 /app/controllers/matches_controller.rb
parent2d097c71a32646fce3b90608cbffde9992c979ef (diff)
parentedec37791164f1c32c8071784a8a02aa63afae55 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/controllers/matches_controller.rb')
-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 8ef5e76..f196978 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