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

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

Zac Wood's avatar
Zac Wood committed
13
14
15
16
  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'
17
    resources :course_listings, only: [:index]
Zac Wood's avatar
Zac Wood committed
18
    resources :schedules, only: [:index], as: 'api_schedules'
Zac Wood's avatar
Zac Wood committed
19
20
  end

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

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