Class: AuthoritiesController

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

Instance Method Summary collapse

Instance Method Details

#queryObject


19
20
21
22
23
24
25
26
27
# File 'app/controllers/authorities_controller.rb', line 19

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