0

I want to soft delete(archive) records through the index view but the default action actually destroys the record completely rather than adding a timestamp deleted_at column.

Ive tried to override the link_to method to be sure that activeadmin isnt doing anything to the link but it had no effect on the outcome

link_to "Archive", admin_events_path(resource), method: :delete, confirm: "Are you sure?", class: "member_link delete_link"
Dan Mitchell
  • 844
  • 2
  • 15
  • 34

1 Answers1

0

I found that minglin with active_admin was a bit though when we want to change how it internally does work. But there is a gem -> active_admin_paranoia that does exactly what you need. Now all you have to do is set up paranoia gem properly and include act_as_paranoid in your model declaration.

link to the gem: https://github.com/raihan2006i/active_admin_paranoia

beniutek
  • 1,672
  • 15
  • 32