Class: AuthoritiesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/authorities_controller.rb

Instance Method Summary collapse

Instance Method Details

#queryObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/authorities_controller.rb', line 5

def query
  s = params.fetch("q", "")
  hits = if params[:term] == "location"
    GeoNamesResource.find_location(s)
  else
    LocalAuthority.entries_by_term(params[:model], params[:term], s) rescue []
  end
  render json: hits
end