static public Method

Base.delete(id, options = {})

Contents:

Deletes the resources with the ID in the id parameter.

Options

All options specify prefix and query parameters.

Examples

Event.delete(2)
# => DELETE /events/2

Event.create(:name => 'Free Concert', :location => 'Community Center')
my_event = Event.find(:first)
# => Events (id: 7)
Event.delete(my_event.id)
# => DELETE /events/7

# Let's assume a request to events/5/cancel.xml
Event.delete(params[:id])
# => DELETE /events/5

Source Code

# File active_resource/base.rb, line 426
def delete(id, options = {})
  connection.delete(element_path(id, options))
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.