course_sections_controller.rb 357 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1
# Contains all actions having to do with CourseSections.
Zac Wood's avatar
Zac Wood committed
2
# This is a nested controller -- see +config/routes.rb+ for details
Zac Wood's avatar
Zac Wood committed
3
class CourseSectionsController < ApplicationController
Zac Wood's avatar
Zac Wood committed
4 5
  # Render JSON of all Sections belonging to a given Course.
  def index
6
    @sections = CourseSection.where(course_id: params[:course_id])
Zac Wood's avatar
Zac Wood committed
7 8 9
    render json: @sections
  end
end