Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created December 7, 2008 22:49
Show Gist options
  • Save ashgti/33276 to your computer and use it in GitHub Desktop.
Save ashgti/33276 to your computer and use it in GitHub Desktop.
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do
authenticate do
namespace :admin do
match('/').to(:controller => 'dash', :action => 'index').name(:dash)
resources :users
resources :teams
resources :seasons do
resources :games
end
end
with(:controller => 'transactions') do
match('/seasons/:season_id/games/:game_id/buy_shares').to(:action => 'buy_shares').name(:buy_shares)
match('/seasons/:season_id/games/:game_id/buy_shares', :method => :post).to(:action => 'new')
end
end
with :controller => 'seasons' do
match('/seasons').to(:action => 'index').name(:seasons)
match('/seasons/:id').to(:action => 'show').name(:season)
with :controller => 'games' do
match('/seasons/:season_id/games/').to(:action => 'index').name(:games)
match('/seasons/:season_id/games/:id').to(:action => 'show').name(:game)
end
end
with(:controller => 'users') do
match('/signup', :method => :post).to(:action => 'create')
match('/signup').to(:action => 'new').name(:signup)
end
# Adds the required routes for merb-auth using the password slice
slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix => "")
match('/').to(:controller => 'dash', :action => 'index').name(:dash)
end
#####
rake audit:routes:
Named Routes
signup: /signup
game: /seasons/:season_id/games/:id
edit_admin_season_game: /admin/seasons/:season_id/games/:id/edit(.:format)
admin_teams: /admin/teams(/index)(.:format)
edit_admin_season: /admin/seasons/:id/edit(.:format)
admin_team: /admin/teams/:id(.:format)
admin_users: /admin/users(/index)(.:format)
games: /seasons/:season_id/games/
season: /seasons/:id
delete_admin_season_game: /admin/seasons/:season_id/games/:id/delete(.:format)
admin_season: /admin/seasons/:id(.:format)
new_admin_team: /admin/teams/new(.:format)
dash: /
admin_season_game: /admin/seasons/:season_id/games/:id(.:format)
delete_admin_season: /admin/seasons/:id/delete(.:format)
new_admin_user: /admin/users/new(.:format)
edit_admin_team: /admin/teams/:id/edit(.:format)
login: /login
delete_admin_team: /admin/teams/:id/delete(.:format)
admin_dash: /admin/
admin_season_games: /admin/seasons/:season_id/games(/index)(.:format)
edit_admin_user: /admin/users/:id/edit(.:format)
admin_user: /admin/users/:id(.:format)
perform_login: /login
admin_seasons: /admin/seasons(/index)(.:format)
seasons: /seasons
new_admin_season_game: /admin/seasons/:season_id/games/new(.:format)
delete_admin_user: /admin/users/:id/delete(.:format)
logout: /logout
buy_shares: /seasons/:season_id/games/:game_id/buy_shares
new_admin_season: /admin/seasons/new(.:format)
Anonymous Routes
/admin/users(.:format)
/admin/users/:id(.:format)
/admin/users/:id(.:format)
/admin/teams(.:format)
/admin/teams/:id(.:format)
/admin/teams/:id(.:format)
/admin/seasons(.:format)
/admin/seasons/:id(.:format)
/admin/seasons/:id(.:format)
/admin/seasons/:season_id/games(.:format)
/admin/seasons/:season_id/games/:id(.:format)
/admin/seasons/:season_id/games/:id(.:format)
/seasons/:season_id/games/:game_id/buy_shares
/signup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment