Last active
December 24, 2015 00:39
-
-
Save cupakromer/6718222 to your computer and use it in GitHub Desktop.
Route dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AcmeInc::Application.routes.draw do | |
resources :accounts # /spec/routes/accounts_routing_spec.rb | |
resources :users # /spec/routes/users_routing_spec.rb | |
resources :widgets # /spec/routes/widgets_routing_spec.rb | |
resources :shippers do | |
# All of these tests would go in /spec/routes/shippers_routing_spec.rb | |
member do | |
get 'scans', :to => 'shippers#member_scans' | |
end | |
collection do | |
get 'scans', :to => 'shippers#collection_scans' | |
get 'map' | |
end | |
end | |
get "/widget_groups" => redirect("/#/groups") # /spec/routes/root_routing_spec.rb | |
match "/tracking/:id/:start_time/:end_time", to: "tracking#index" # /spec/routes/root_routing_spec.rb | |
get "docs/(:name)", to: 'docs#show', constraints: {:name => /.*/} # /spec/routes/root_routing_spec.rb | |
match '/api' => 'api/accounts#root', as: 'api_root' # /spec/routes/api_routing_spec.rb | |
scope 'api', module: 'api', as: 'api' do | |
# Widgets /spec/routes/api/widgets_routing_spec.rb | |
resources :widgets | |
# Purchases - This is almose a full resource so it got | |
# pulled into a simulating one: /spec/routes/api/purchases_routing_spec.rb | |
get 'purchases' => 'purchases#index' | |
get 'purchases/:id' => 'purchases#show', as: 'purchases' | |
put 'purchases/:id' => 'purchases#update', as: nil | |
post 'purchases' => 'purchases#create' | |
delete 'purchases/:id' => 'purchases#destroy', as: nil | |
# Pulse - for NewRelic Availability Monitoring | |
# /spec/routes/api_routing_spec.rb | |
get 'pulse' => 'pulse#show' | |
post 'logs' => 'logs#create' # /spec/routes/api_routing_spec.rb | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment