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 4ca64d4d941146c5a90916eb862a83a8a6d7a08a
class
OntologySearchController
<
ApplicationController
def
search
if
params
[:
query
].
present
?
@
search_response
=
Ontology.search
(
params
[:
query
])
.
records
else
@
search_response
=
Ontology.scoped
end
unless
params
[:
ontology_type
].
empty
?
@
search_response
= @
search_response.filter
_by_ontology_type
(
params
[:
ontology_type
])
end
unless
params
[:
project
].
empty
?
@
search_response
= @
search_response.filter
_by_project
(
params
[:
project
])
end
unless
params
[:
formality_level
].
empty
?
@
search_response
= @
search_response.filter
_by_formality
(
params
[:
formality_level
])
end
unless
params
[:
license
].
empty
?
@
search_response
= @
search_response.filter
_by_license
(
params
[:
license
])
end
unless
params
[:
task
].
empty
?
@
search_response
= @
search_response.filter
_by_task
(
params
[:
task
])
end
@
search_response
=
paginate_for
(@
search_response
)
render
'shared/_ontology_search'
end
end