Module: ResourcesController::SingletonActions

Includes:
Actions
Defined in:
lib/resources_controller/singleton_actions.rb

Instance Method Summary collapse

Methods included from Actions

#create, #edit, #index, #new, #show, #update

Instance Method Details

#destroyObject

DELETE /event DELETE /event.json

[View source] [View on GitHub]

9
10
11
12
13
14
15
16
17
18
# File 'lib/resources_controller/singleton_actions.rb', line 9

def destroy
  self.resource = destroy_resource
  respond_to do |format|
    format.html { 
      redirect_to enclosing_resource_url if enclosing_resource
      flash[:notice] = "#{resource_name.humanize} was successfully destroyed."
    }
    format.json { head :no_content }
  end
end