List Info

Thread: need a warning for destroy all




need a warning for destroy all
user name
2006-08-14 22:20:27
I wrote a small controller to find all the expired items and
destroy 
them:

listtodestroy=Product.find(:all, :conditions =>
['user_id = ? AND 
date_expires <= ?', user.id, Time.now])
      for product in listtodestroy
        product.destroy
      end

It works fine but there's no warning that everything is
about to be 
removed like when I call product.destroy on an id instead of
array.  Is 
there a simple way to call the "Are you sure?"
dialog for the above?

Thanks..

-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
Rails mailing list
Railslists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )