2012-08-31 03:01:52 +00:00
|
|
|
SampleApp::Application.routes.draw do
|
2012-08-31 13:18:37 +00:00
|
|
|
|
2012-09-03 22:03:16 +00:00
|
|
|
scope :as => 'jam_ruby' do
|
2012-09-01 20:24:51 +00:00
|
|
|
resources :users
|
2012-10-03 00:54:29 +00:00
|
|
|
resources :music_sessions
|
2012-09-03 22:03:16 +00:00
|
|
|
end
|
2012-08-31 13:18:37 +00:00
|
|
|
|
2012-09-03 22:03:16 +00:00
|
|
|
resources :users
|
2012-10-03 00:54:29 +00:00
|
|
|
resources :music_sessions
|
2012-10-15 12:46:51 +00:00
|
|
|
resources :friend_requests
|
2012-09-03 22:03:16 +00:00
|
|
|
|
2012-08-31 03:01:52 +00:00
|
|
|
resources :sessions, only: [:new, :create, :destroy]
|
2012-09-03 22:03:16 +00:00
|
|
|
|
2012-08-31 03:01:52 +00:00
|
|
|
root to: 'static_pages#home'
|
|
|
|
|
|
|
|
|
|
match '/signup', to: 'users#new'
|
|
|
|
|
match '/signin', to: 'sessions#new'
|
|
|
|
|
match '/signout', to: 'sessions#destroy', via: :delete
|
2012-09-03 22:03:16 +00:00
|
|
|
|
2012-08-31 03:01:52 +00:00
|
|
|
match '/help', to: 'static_pages#help'
|
|
|
|
|
match '/about', to: 'static_pages#about'
|
|
|
|
|
match '/contact', to: 'static_pages#contact'
|
|
|
|
|
|
2012-09-21 04:46:45 +00:00
|
|
|
match '/client', to: 'clients#index'
|
|
|
|
|
|
2012-10-03 00:54:29 +00:00
|
|
|
scope '/api' do
|
2012-10-14 02:22:13 +00:00
|
|
|
# music sessions
|
2012-10-04 02:09:01 +00:00
|
|
|
match '/sessions/:id/participants' => 'api_music_sessions#participant_create', :via => :post
|
2012-10-23 12:44:17 +00:00
|
|
|
match '/participants/:id' => 'api_music_sessions#participant_show', :via => :get, :as => 'api_session_participant_detail'
|
|
|
|
|
match '/participants/:id' => 'api_music_sessions#participant_delete', :via => :delete
|
2012-10-03 03:57:27 +00:00
|
|
|
match '/sessions/:id' => 'api_music_sessions#show', :via => :get, :as => 'api_session_detail'
|
|
|
|
|
match '/sessions/:id' => 'api_music_sessions#delete', :via => :delete
|
|
|
|
|
match '/sessions' => 'api_music_sessions#index', :via => :get
|
|
|
|
|
match '/sessions' => 'api_music_sessions#create', :via => :post
|
|
|
|
|
|
2012-10-25 15:08:55 +00:00
|
|
|
# genres
|
|
|
|
|
match '/genres' => 'api_genres#index', :via => :get
|
|
|
|
|
|
2012-10-14 02:22:13 +00:00
|
|
|
# users
|
|
|
|
|
match '/users' => 'api_users#index', :via => :get
|
|
|
|
|
match '/users/:id' => 'api_users#show', :via => :get, :as => 'api_user_detail'
|
2012-10-15 12:46:51 +00:00
|
|
|
match '/users' => 'api_users#create', :via => :post
|
|
|
|
|
match '/users/:id' => 'api_users#update', :via => :put
|
2012-10-14 02:22:13 +00:00
|
|
|
match '/users/:id' => 'api_users#destroy', :via => :delete
|
|
|
|
|
|
2012-10-29 10:46:24 +00:00
|
|
|
# bands
|
|
|
|
|
match '/bands' => 'api_bands#index', :via => :get
|
2012-10-31 03:28:17 +00:00
|
|
|
match '/bands/:id' => 'api_bands#show', :via => :get, :as => 'api_band_detail'
|
|
|
|
|
=begin
|
2012-10-29 10:46:24 +00:00
|
|
|
match '/bands' => 'api_bands#create', :via => :post
|
2012-10-31 03:28:17 +00:00
|
|
|
match '/bands/:id' => 'api_bands#update', :via => :post
|
|
|
|
|
match '/bands/:id/musicians' => 'api_bands#musicians_index', :via => :get
|
2012-10-29 10:46:24 +00:00
|
|
|
=end
|
|
|
|
|
|
2012-10-14 02:22:13 +00:00
|
|
|
# friend requests
|
|
|
|
|
match '/users/:id/friend_requests' => 'api_users#friend_request_index', :via => :get
|
2012-10-15 12:46:51 +00:00
|
|
|
match '/friend_requests/:id' => 'api_users#friend_request_show', :via => :get, :as => 'api_friend_request_detail'
|
|
|
|
|
match '/friend_requests' => 'api_users#friend_request_create', :via => :post
|
|
|
|
|
match '/friend_requests/:id' => 'api_users#friend_request_update', :via => :put
|
2012-10-14 02:22:13 +00:00
|
|
|
|
|
|
|
|
# friends
|
|
|
|
|
match '/users/:id/friends' => 'api_users#friend_index', :via => :get
|
|
|
|
|
match '/users/:id/friends/:friend_id' => 'api_users#friend_destroy', :via => :delete
|
2012-10-27 22:26:45 +00:00
|
|
|
|
|
|
|
|
# invitations
|
|
|
|
|
match '/invitations/:id' => 'api_invitations#show', :via => :get, :as => 'api_invitation_detail'
|
|
|
|
|
match '/invitations/:id' => 'api_invitations#delete', :via => :delete
|
|
|
|
|
match '/invitations' => 'api_invitations#index', :via => :get
|
|
|
|
|
match '/invitations' => 'api_invitations#create', :via => :post
|
2012-10-03 00:54:29 +00:00
|
|
|
end
|
2012-08-31 02:09:02 +00:00
|
|
|
end
|