我是Ruby on Rails的新手。我正在为我的应用程序使用Active Admin。可以使用“批处理操作”删除记录。我想显示我使用列表上的批处理操作删除的所有记录。
是否可以修改批处理操作的代码,以便可以查看已删除的记录?
这是我用于销毁选项的代码。
batch_action :destroy, :confirm => "Are you sure you want to delete these records?" do |ids|
record_ids = Application::Record.where(id: ids).pluck(:record_id)
Application::Record.where(id: record_ids).destroy_all
redirect_to record_path, :notice => "Successfully destroyed records"
end
任何帮助将不胜感激。