search_controller.rb 233 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
5
6
7
8
9
    if params.key?(:crn)
      crn = params[:crn]
      @sections = Section.find_by_crn(crn)
      render json: @sections
    else
      render status: 404
    end
Zac Wood's avatar
Zac Wood committed
10
11
  end
end