Cross Reference: base.rb
xref
: /
ontohub
/
app
/
controllers
/
polymorphic_resource
/
base.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
base.rb revision 068c4812bb4a75942b62c2124ca1875525b3ac5c
98
N/A
#
98
N/A
# Indexes, creates and deletes entries of a collection
98
N/A
# To be subclassed
98
N/A
#
98
N/A
class
PolymorphicResource
::
Base
<
InheritedResources
::
Base
98
N/A
98
N/A
actions
:
index
, :
create
98
N/A
respond_to
:
json
, :
xml
98
N/A
98
N/A
def
create
98
N/A
authorize
! :
create
,
build_resource
98
N/A
resource.user
=
current_user
98
N/A
98
N/A
super
do
|
format
|
98
N/A
format.html
do
98
N/A
if
resource.errors.empty
?
98
N/A
render
:
partial
=>
resource
98
N/A
else
98
N/A
render
:
partial
=>
'form'
, :
status
=> :
unprocessable_entity
98
N/A
end
98
N/A
end
98
N/A
end
98
N/A
end
98
N/A
98
N/A
def
destroy
98
N/A
authorize
! :
destroy
,
resource
98
N/A
resource.destroy
98
N/A
head
:
ok
98
N/A
end
98
N/A
end
98
N/A