Cross Reference:
xref
: /
ontohub
/
app
/
controllers
/
sentences_controller.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
sentences_controller.rb revision e3885aacc4f26c817827173a754510807b6bc84c
#
# Lists sentences of an ontology
#
class
SentencesController
<
InheritedResources
::
Base
belongs_to
:
ontology
actions
:
index
has_pagination
respond_to
:
html
,
only
: %i
(
index
)
before_filter
:
check_read_permissions
protected
def
check_read_permissions
authorize
! :
show
,
parent.repository
end
def
collection
if
display_all
?
if
logically_translated
?
Kaminari.paginate
_array
(
parent.all
_sentences
)
.
page
(
params
[:
page
])
else
Kaminari.paginate
_array
(
parent.translated
_sentences
)
.
page
(
params
[:
page
])
end
else
super
end
end
def
logically_translated
?
parent.contains
_logic_translations
?
end
helper_method
:
logically_translated
?
end