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
(http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001041).
delete is actually a class method that should be given the id or ids of
the records you want to delete
(http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000997)
--
----------------------------
Autopendium :: Stuff about old cars
http://autopendium.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---