# app/avo/base_resource.rb
class Avo::BaseResource < Avo::Resources::Base
  self.index_controls = -> {
    # Don't show bulk destroy for these resources
    return default_controls if resource.class.in?([
      Avo::Resources::User,
      Avo::Resources::Post,
      Avo::Resources::Product,
      Avo::Resources::Person,
      Avo::Resources::Spouse,
      Avo::Resources::Movie,
      Avo::Resources::Fish,
    ])

    bulk_title = tag.span(class: "text-xs") do
      safe_join([
        "Delete all selected #{resource.plural_name.downcase}",
        tag.br,
        "Select at least one #{resource.singular_name.downcase} to run this action"
      ])
    end.html_safe

    action Avo::Actions::BulkDestroy,
      icon: "heroicons/solid/trash",
      color: "red",
      label: "",
      style: :outline,
      title: bulk_title

    default_controls
  }
end
```

## Feedback

We value your experience with this bulk destroy implementation! Whether you've successfully implemented it, made improvements, or encountered challenges, your feedback helps the community. Here's how you can contribute:

- **Success stories**: Share how you've implemented this in your project and what benefits it brought to your workflow
- **Improvements**: Tell us if you've enhanced this implementation with additional features or better error handling
- **Questions**: Ask about specific use cases or implementation details you're unsure about
- **Troubleshooting**: If you're experiencing issues, describe your setup and the problems you're encountering
- **Customizations**: Share how you've adapted this to better suit your specific needs
- **Alternative approaches**: If you've implemented bulk destroy differently, we'd love to hear about your solution

You can share your feedback through [Feedback: Bulk destroy action using customizable controls](https://github.com/avo-hq/avo/discussions/3930).

---