syntax for delete

Mahendra wrote:

Hi,

I am saving my data using object.save like this:

@project = Project.new(params[:project])      @project.save

How can i delete same. I am using   @project.delete But it is giving me error.

Plz. help...

In general it's always a good idea to say what the error is, but normally you'd use destroy to achieve this: @project.destroy (ActiveRecord::Base). delete is actually a class method that should be given the id or ids of the records you want to delete (ActiveRecord::Base)