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 a60927fe2101305fea1eeb5312bd2f292d29c2a9
baf6671fd3847865da9b64dc8f8be85d81304840
Daniel Lezcano
class
CategoriesController
<
InheritedResources
::
Base
baf6671fd3847865da9b64dc8f8be85d81304840
Daniel Lezcano
baf6671fd3847865da9b64dc8f8be85d81304840
Daniel Lezcano
belongs_to
:
ontology
, :
optional
=>
true
baf6671fd3847865da9b64dc8f8be85d81304840
Daniel Lezcano
def
index
if
params
[:
ontology_id
]
@
ontology
=
Ontology.find
(
params
[:
ontology_id
])
@
categories
=
Kaminari.paginate
_array
(@
ontology.categories
)
.
page
(
params
[:
page
])
else
@
c_vertices
= []
vert
=
Category.first
if
vert
@
c_vertices
=
vert.roots.first.children
end
end
end
def
show
@
category
=
Category.find
(
params
[:
id
])
@
ontologies
= @
category.related
_ontologies
end
end