summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb34
1 files changed, 28 insertions, 6 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 262a156..4094479 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,24 +1,46 @@
Leaguer::Application.routes.draw do
- resources :brackets
- resources :sessions
+ resources :sessions, only: [:new, :create, :destroy]
resources :users
resources :games
- resources :tournaments
-
resources :pms
resources :alerts
resources :teams
- resources :matches
+ resources :tournaments do
+ resources :matches, only: [:index, :show, :update]
+ resources :brackets, only: [:create, :index, :show, :edit, :update, :destroy]
+ end
+
+ resource :server, only: [:show, :edit, :update]
+
+ root to: 'main#homepage'
+
+ get '/search', to: 'search#go'
- resources :servers
+end
+
+Leaguer::Application.routes.named_routes.module.module_eval do
+ def match_path(match, options={})
+ tournament_match_path(match.tournament_stage.tournament, match, options)
+ end
+ def match_url(match, options={})
+ tournament_match_url(match.tournament_stage.tournament, match, options)
+ end
+ def bracket_path(bracket, options={})
+ tournament_bracket_path(bracket.tournament, bracket, options)
+ end
+ def bracket_url(bracket, options={})
+ tournament_bracket_url(bracket.tournament, bracket, options)
+ end
+end
+if false
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".