routes.rb 1.07 KB
Newer Older
1
# Registers all routes for the app.
Zac Wood's avatar
Zac Wood committed
2
Rails.application.routes.draw do
3
4
  get 'about', to: 'about#index', as: 'about'

5
  get '/', to: 'home#index', as: 'home'
Zac Wood's avatar
Zac Wood committed
6
  get 'search', to: 'search#index', as: 'search'
Zac Wood's avatar
Zac Wood committed
7
  get 'sessions/update', as: 'update_session'
8
  get 'sessions/cart'
Zac Wood's avatar
Zac Wood committed
9
  get 'sessions/add_bulk'
10

Zac Wood's avatar
Zac Wood committed
11
  resources :courses, only: [:show]
Zac Wood's avatar
Zac Wood committed
12
  resources :course_sections, only: [:show]
13
  resources :instructors, only: [:index, :show]
Zac Wood's avatar
Zac Wood committed
14
  get 'schedule', to: 'schedules#show', as: 'schedule'
15
  get 'schedule/events', to: 'schedules#events'
Zac Wood's avatar
Zac Wood committed
16
  get 'schedule/view', to: 'schedules#view', as: 'view_schedule'
Zac Wood's avatar
Zac Wood committed
17

Zac Wood's avatar
Zac Wood committed
18
  scope :api, module: 'api' do # Register /api routes
Zac Wood's avatar
Zac Wood committed
19
    resources :semesters, only: [:index], as: 'api_semesters'
Zac Wood's avatar
Zac Wood committed
20
21
22
    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'
23
    resources :course_listings, only: [:index]
Zac Wood's avatar
Zac Wood committed
24
    resources :schedules, only: [:index], as: 'api_schedules'
Zac Wood's avatar
Zac Wood committed
25
26
  end

Zac Wood's avatar
Zac Wood committed
27
  apipie # sets up API docs
Zac Wood's avatar
Zac Wood committed
28

29
  root to: 'home#index'
Zac Wood's avatar
Zac Wood committed
30
end