Skip to content

Instantly share code, notes, and snippets.

@lalitlogical
Created December 18, 2018 06:15
Show Gist options
  • Save lalitlogical/4d4ba5da77c6168bbcaf8c22568af812 to your computer and use it in GitHub Desktop.
Save lalitlogical/4d4ba5da77c6168bbcaf8c22568af812 to your computer and use it in GitHub Desktop.
rails admin delete override
# config/initializers/rails_admin_delete_override.rb
module RailsAdmin
module Config
module Actions
class Delete < RailsAdmin::Config::Actions::Base
RailsAdmin::Config::Actions.register(self)
register_instance_option :visible? do
!bindings[:object].respond_to?(:destroyable?) || bindings[:object].destroyable?
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment