routes.rb 649 Bytes
Newer Older
1
# Registers all routes for the app.
Zac Wood's avatar
Zac Wood committed
2
Rails.application.routes.draw do
Zac Wood's avatar
Zac Wood committed
3
  get 'search', to: 'search#index'
Zac Wood's avatar
Zac Wood committed
4
  get 'sessions/update', as: 'update_session'
5
  get 'sessions/cart'
6

Zac Wood's avatar
Zac Wood committed
7
  resources :courses, only: [:show]
8
  resources :instructors, only: [:index, :show]
Zac Wood's avatar
Zac Wood committed
9
  get 'schedule', to: 'schedules#show', as: 'schedule'
Zac Wood's avatar
Zac Wood committed
10
  
11
  scope :api do # Register /api routes
12
    resources :courses, only: [:index, :show]
13
    resources :course_sections, only: [:index]
14
    resources :instructors, only: [:index, :show]
15
    resources :course_listings, only: [:index]
16
    resources :schedules, only: [:index]
Zac Wood's avatar
Zac Wood committed
17 18
  end

19
  apipie # sets up API docs
Zac Wood's avatar
Zac Wood committed
20

21
  root to: 'home#index'
Zac Wood's avatar
Zac Wood committed
22
end