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 2da24154575de5ed5b48287bfc860d372c600c89
10139
N/A
class
CategoriesController
<
InheritedResources
::
Base
10139
N/A
10139
N/A
belongs_to
:
ontology
,
optional
:
true
20784
N/A
before_filter
:
check_read_permissions
10139
N/A
10139
N/A
load_and_authorize_resource
10139
N/A
17185
N/A
def
index
10139
N/A
if
params
[:
ontology_id
]
17177
N/A
@
ontology
=
Ontology.find
(
params
[:
ontology_id
])
18602
N/A
@
categories
=
Kaminari.paginate
_array
(@
ontology.categories
)
.
page
(
params
[:
page
])
17177
N/A
else
10139
N/A
@
c_vertices
= []
19094
N/A
if
vert
=
Category.first
10139
N/A
@
c_vertices
=
vert.roots.first.children
10139
N/A
end
20784
N/A
end
10139
N/A
end
10139
N/A
18602
N/A
def
show
10139
N/A
@
category
=
Category.find
(
params
[:
id
])
20784
N/A
@
ontologies
= @
category.related
_ontologies
13776
N/A
end
13776
N/A
13776
N/A
protected
10139
N/A
15871
N/A
def
check_read_permissions
10139
N/A
authorize
! :
show
,
parent.repository
if
parent.is
_a
?
Ontology
15871
N/A
end
15192
N/A
15871
N/A
end
16446
N/A