public Method

Base.destroy

Deletes the resource from the remote service.

Examples

my_id = 3
my_person = Person.find(my_id)
my_person.destroy
Person.find(my_id)
# => 404 (Resource Not Found)

new_person = Person.create(:name => 'James')
new_id = new_person.id
# => 7
new_person.destroy
Person.find(new_id)
# => 404 (Resource Not Found)

Source Code

# File active_resource/base.rb, line 669
def destroy
  connection.delete(element_path, self.class.headers)
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.