Class: ResearchersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/researchers_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#new_session_path

Instance Method Details

#ajax_listObject



5
6
7
8
9
# File 'app/controllers/researchers_controller.rb', line 5

def ajax_list
  search_term = params["query"] || ""
  researchers = { suggestions: Researcher.autocomplete_list(search_term) }
  render json: researchers.to_json
end

#indexObject



11
12
13
# File 'app/controllers/researchers_controller.rb', line 11

def index
  @researchers = Researcher.all
end