When I try to destroy a record from the index page and the record fails to be destroyed, I am redirected back to the index page with status code 404.
I expect to be redirected to the index page with status code 200, as it happens when I try to destroy the same record from the show page.
The issue is related on how the destroy and the index action interact with the flash[:error].
On /lib/rails_admin/config/actions/delete.rb:40 the flash[:error] is set with the error message after the object destruction fails.
On /lib/rails_admin/config/actions/index.rb:44 the status code :not_found is returned if flash[:error] is present, which is not the right decision in this situation.
When I try to destroy a record from the index page and the record fails to be destroyed, I am redirected back to the index page with status code 404.
I expect to be redirected to the index page with status code 200, as it happens when I try to destroy the same record from the show page.
The issue is related on how the destroy and the index action interact with the
flash[:error].On /lib/rails_admin/config/actions/delete.rb:40 the
flash[:error]is set with the error message after the object destruction fails.On /lib/rails_admin/config/actions/index.rb:44 the status code
:not_foundis returned ifflash[:error]is present, which is not the right decision in this situation.