Cross Reference: categories_controller.rb
xref
: /
ontohub
/
app
/
controllers
/
categories_controller.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
categories_controller.rb revision 17e3eda463c5fe407b4498c996c7fd0474e34e41
class
CategoriesController
<
InheritedResources
::
Base
belongs_to
:
ontology
,
optional
:
true
load_and_authorize_resource
def
index
if
params
[:
ontology_id
]
@
ontology
=
Ontology.find
(
params
[:
ontology_id
])
@
categories
=
Kaminari.paginate
_array
(@
ontology.categories
)
.
page
(
params
[:
page
])
else
@
c_vertices
= []
if
vert
=
Category.first
@
c_vertices
=
vert.roots.first.children
end
end
end
def
show
@
category
=
Category.find
(
params
[:
id
])
@
ontologies
= @
category.related
_ontologies
end
end