Sha256: c571afe0f967d232b644318b08d1f8c3fdba8cd051f13a311e12b35325912683
Contents?: true
Size: 940 Bytes
Versions: 21
Compression:
Stored size: 940 Bytes
Contents
# Copyright © 2012 The Pennsylvania State University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'rdf' require 'cgi' class AuthoritiesController < ApplicationController 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 end
Version data entries
21 entries across 21 versions & 1 rubygems