Module: SimpleResourceController::Controller::Actions::Destroy

Defined in:
lib/simple_resource_controller/controller/actions.rb

Instance Method Summary collapse

Instance Method Details

#destroy(options = {}, &block) ⇒ Object Also known as: destroy!



65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/simple_resource_controller/controller/actions.rb', line 65

def destroy(options={}, &block)
  resource.destroy

  unless block_given?
    if current_controller_api?
      api_before_destroy_response_callback(options)
    else
      html_before_destroy_response_callback(options)
    end
  end

  respond_with resource, options, &block
end