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
Rails lists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
|