routes.rb 778 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'
Zac Wood's avatar
Zac Wood committed
6
  get 'sessions/add_bulk'
7

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

Zac Wood's avatar
Zac Wood committed
12 13 14 15
  scope :api, module: 'api' do # Register /api routes
    resources :courses, only: [:index, :show], as: 'api_courses'
    resources :course_sections, only: [:index], as: 'api_course_sections'
    resources :instructors, only: [:index, :show], as: 'api_instructors'
16
    resources :course_listings, only: [:index]
Zac Wood's avatar
Zac Wood committed
17
    resources :schedules, only: [:index], as: 'api_schedules'
Zac Wood's avatar
Zac Wood committed
18 19
  end

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

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