diff options
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/config/routes.rb b/config/routes.rb index 262a156..a4df5b4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,24 +1,47 @@ 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 + 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". |