search_controller.rb 239 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1 2
class SearchController < ApplicationController
  def index
Zac Wood's avatar
Zac Wood committed
3 4
    if params.key?(:crn)
      crn = params[:crn]
Zac Wood's avatar
Zac Wood committed
5
      @sections = CourseSection.find_by_crn(crn)
Zac Wood's avatar
Zac Wood committed
6 7 8 9
      render json: @sections
    else
      render status: 404
    end
Zac Wood's avatar
Zac Wood committed
10 11
  end
end