method

delete

Importance_1
v2.1.0 - Show latest stable - 0 notes - Class: ActiveResource::Base
delete(id, options = {}) public

Deletes the resources with the ID in the id parameter.

Options

All options specify prefix and query parameters.

Examples

  Event.delete(2) # sends DELETE /events/2

  Event.create(:name => 'Free Concert', :location => 'Community Center')
  my_event = Event.find(:first) # let's assume this is event with ID 7
  Event.delete(my_event.id) # sends DELETE /events/7

  # Let's assume a request to events/5/cancel.xml
  Event.delete(params[:id]) # sends DELETE /events/5
Show source
Register or log in to add new notes.