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…
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…
Mahendra wrote:
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)
Autopendium :: Stuff about old cars
http://autopendium.com
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs