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

Version Path
sufia-3.1.2 app/controllers/authorities_controller.rb
sufia-3.1.1 app/controllers/authorities_controller.rb
sufia-3.1.0 app/controllers/authorities_controller.rb
sufia-3.0.0 app/controllers/authorities_controller.rb
sufia-2.0.1 app/controllers/authorities_controller.rb
sufia-2.0.0 app/controllers/authorities_controller.rb
sufia-1.3.0 app/controllers/authorities_controller.rb
sufia-1.2.0 app/controllers/authorities_controller.rb
sufia-1.1.0 app/controllers/authorities_controller.rb
sufia-1.0.0 app/controllers/authorities_controller.rb
sufia-0.1.0 app/controllers/authorities_controller.rb
sufia-0.0.8 app/controllers/authorities_controller.rb
sufia-0.0.7 app/controllers/authorities_controller.rb
sufia-0.0.6 app/controllers/authorities_controller.rb
sufia-0.0.5 app/controllers/authorities_controller.rb
sufia-0.0.4 app/controllers/authorities_controller.rb
sufia-0.0.3 app/controllers/authorities_controller.rb
sufia-0.0.2 app/controllers/authorities_controller.rb
sufia-0.0.1 app/controllers/authorities_controller.rb
sufia-0.0.1.pre2 app/controllers/authorities_controller.rb