From f91717ad1803cf547324e21899dd2e279852b43c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 6 Apr 2014 22:26:05 -0400 Subject: indent the matches_controller --- app/controllers/matches_controller.rb | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'app/controllers/matches_controller.rb') diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index ee68e11..feeda02 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -3,22 +3,20 @@ 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 - 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 +115,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 -- cgit v1.2.3 From 5798dd7da423895a5c8561800f7d78859e6ab000 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 6 Apr 2014 22:26:28 -0400 Subject: MatchesController: define matches_url --- app/controllers/matches_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers/matches_controller.rb') diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index feeda02..5c654dd 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -15,6 +15,12 @@ class MatchesController < ApplicationController @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? -- cgit v1.2.3