Class: Rack::MongoidAdapter::Controllers::DestroyController
Instance Attribute Summary
Attributes inherited from Base
#env
Instance Method Summary
collapse
Methods inherited from Base
call, #call, #initialize
Instance Method Details
#response_body ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/rack/mongoid_adapter/controllers/destroy_controller.rb', line 13
def response_body
if resource
connection.find(_id: id).remove
resource.to_json
else
response_body_for_not_found
end
end
|
#response_status ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/rack/mongoid_adapter/controllers/destroy_controller.rb', line 5
def response_status
if resource
200
else
404
end
end
|