Cross Reference:
xref
: /
ontohub
/
app
/
controllers
/
entities_controller.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
entities_controller.rb revision f2fe7b6bb33c8afe035ccda0fb4685eeaa37f199
402
N/A
#
402
N/A
# Lists entities of an ontology
402
N/A
#
402
N/A
class
EntitiesController
<
InheritedResources
::
Base
402
N/A
402
N/A
belongs_to
:
ontology
402
N/A
402
N/A
actions
:
index
402
N/A
has_scope
:
kind
402
N/A
has_pagination
402
N/A
respond_to
:
json
, :
xml
402
N/A
402
N/A
def
index
402
N/A
ontology
=
Ontology.find
params
[:
ontology_id
]
402
N/A
if
ontology.logic.name
==
"OWL2"
||
ontology.logic.name
==
"OWL"
402
N/A
if
ontology
402
N/A
begin
402
N/A
@
nodes
=
ontology.entities.first.roots.first.children
402
N/A
rescue
402
N/A
@
nodes
= []
402
N/A
end
@
hierarchy_exists
= !@
nodes.empty
?
end
end
index
!
do
|
format
|
format.html
do
unless
collection.blank
?
first_entity
=
collection.first
@
show_name_column
= !
(
first_entity.display
_name
or
first_entity.text.include
?
first_entity.name
)
end
end
end
end
end