Class: Cathode::DestroyRequest
- Defined in:
- lib/cathode/destroy_request.rb
Overview
Defines the default behavior for a destroy request.
Instance Attribute Summary
Attributes inherited from Request
#_body, #_status, #action, #context, #custom_logic, #resource
Instance Method Summary collapse
-
#default_action_block ⇒ Object
Sets the default action to destroy a resource.
Methods inherited from Request
Constructor Details
This class inherits a constructor from Cathode::Request
Instance Method Details
#default_action_block ⇒ Object
Sets the default action to destroy a resource. If the resource is singular, destroys the parent’s associated resource. Otherwise, destroys the resource directly.
7 8 9 10 11 |
# File 'lib/cathode/destroy_request.rb', line 7 def default_action_block proc do record.destroy end end |