Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chamun opened this issue Nov 19, 2016 · 0 comments
Closed

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

chamun opened this issue Nov 19, 2016 · 0 comments

Comments

@chamun
Copy link
Contributor

chamun commented Nov 19, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants