Skip to content

Status code 404 when record fails to be destroyed from the index page #2775

@chamun

Description

@chamun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions