Cross Reference: ontology_search_controller.rb
xref
: /
ontohub
/
app
/
controllers
/
ontology_search_controller.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
ontology_search_controller.rb revision b479f88ab203603ad81cad637cad3b1050184bf2
#
# Ontology search endpoints for the GWT search code.
#
class
OntologySearchController
<
ApplicationController
respond_to
:
json
def
keywords
prefix
=
params
[:
prefix
] ||
''
if
in_repository
?
repository
=
Repository.find
_by_path
params
[:
repository_id
]
respond_with
OntologySearch.new.make
_repository_keyword_list_json
(
repository
,
prefix
)
else
respond_with
OntologySearch.new.make
_global_keyword_list_json
(
prefix
)
end
end
def
search
keywords
=
params
[:
keywords
] || []
respond_with
OntologySearch.new.make
_bean_list_json
(
keywords
)
end
end