routes.rb 611 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

7
  resources :instructors, only: [:index, :show]
Zac Wood's avatar
Zac Wood committed
8
  get 'schedule', to: 'schedules#show', as: 'schedule'
Zac Wood's avatar
Zac Wood committed
9

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

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

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