Manage soft deleted records(paranoia) in rails_admin

邮差的信 提交于 2019-12-24 05:42:55

问题


In my rails 4 app I'm using paranoia to soft delete users and rails_admin for admin interface.

Currently in rails_admin after deleting a record it doesn't show deleted records. I want to see all records in rails_admin where deleted records are marked differently and create a custom action to restore deleted records.

Thanks!


回答1:


You now have deleted scope on your model. Add this to rails_admin config to view your deleted records:

list do
  scopes    [nil, 'deleted']


来源:https://stackoverflow.com/questions/27290670/manage-soft-deleted-recordsparanoia-in-rails-admin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!