search_controller.rb 256 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
    results = SearchHelper::GenericItem.fetchall(String.new(params[:query]), semester: @semester).group_by(&:type)
Zac Wood's avatar
Zac Wood committed
4 5
    @instructors = results[:instructor]
    @courses = results[:course]
Zac Wood's avatar
Zac Wood committed
6 7
  end
end