Cross Reference: ontologies_controller.rb
xref
: /
ontohub
/
app
/
controllers
/
ontologies_controller.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
ontologies_controller.rb revision 068c4812bb4a75942b62c2124ca1875525b3ac5c
#
# Controller for ontologies
#
class
OntologiesController
<
InheritedResources
::
Base
respond_to
:
json
, :
xml
has_pagination
has_scope
:
search
load_and_authorize_resource
:
except
=> [:
index
, :
show
]
respond_to
:
json
def
index
super
do
|
format
|
format.html
do
@
search
=
params
[:
search
]
@
search
=
nil
if
@
search.blank
?
end
end
end
def
show
show
!
{ @
grouped_kinds
=
resource.entities.grouped
_by_kind
}
end
def
new
@
version
=
build_resource.versions.build
end
def
create
@
version
=
build_resource.versions.first
@
version.user
=
current_user
super
end
end