-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Destroy link does not work #1643
Comments
Is this perhaps related to removing jquery-ujs in #1618? My understanding is that that's what ensures the correct request occurs, but I'm sort of surprised it doesn't fallback |
@nickcharlton I confirm that by switching back to 3468644 (commit before the merge of #1618) the issue disappears. |
Damn. If you make sure I'm also surprised we didn't catch this on CI, so that's something to look at too. |
@nickcharlton I'm quite illiterate with this rails-ujs thing and rails engines, would you mind giving a bit more guidance? |
BTW (TL = Turbolinks),
https://discuss.rubyonrails.org/t/turbolinks-doesnt-handle-render/74772/3 Maybe the change to rails UJS imports can be reverted and then upgrade to TL6 when available? |
I think we might just about know as much as each other here, but it seems like we expected the Can you try on Rails 6.1? (or, perhaps replicate it with a failing test so we can see it on CI?) |
I don't have time to dig deeper with Rails 6.1 right now but for what it's worth the issue persists when commenting out |
I looked into why this test passes with rack-test. I really didn't expect what I found... Turns out that Capybara tries to be clever about I created a branch where I tell Capybara not to be clever: master...pablobm:demo-clever-capybara It results in 3 spec failures. I have also added this to https://github.com/thoughtbot/administrate/projects/1, and created a milestone "Release blockers". We should fix this before we release another version. |
Oh! Yikes, that's very unexpected. I did not know it did that by default. What's the best thing to do here, given those failures? |
No idea 😓 I'm going to have to dive into the whole Rails/JS stuff to try clarify all this... |
In #1618, we removed the explicit include of `jquery_ujs` as it should no longer be necessary. Alas, this broke the ability to destroy items. This wasn't caught by the tests because Capybara tries to be clever with these links, sending the `DELETE` directly instead of clicking on the link. We disable this here and switch the specs to use the JS driver so that we're actually testing the functionality (it can't pass without). Adding the include of `jquery_ujs` solves this for now, unblocking us from having a release for lots of other features and allows us to revisit this problem again (in a way that we'll catch it this time!). Fixes #1643.
In #1618, we removed the explicit include of `jquery_ujs` as it should no longer be necessary. Alas, this broke the ability to destroy items. This wasn't caught by the tests because Capybara tries to be clever with these links, sending the `DELETE` directly instead of clicking on the link. We disable this here and switch the specs to use the JS driver so that we're actually testing the functionality (it can't pass without). Adding the include of `jquery_ujs` solves this for now, unblocking us from having a release for lots of other features and allows us to revisit this problem again (in a way that we'll catch it this time!). Fixes #1643.
Can this issue be reopened? I'm still experiencing this issue in v0.18.0 (Rails 6.1 with Turbo & Webpacker). I added Has anyone else resolved this issue in Rails 6.1? |
Hello @mcmaddox, thank you for reporting. Would you be able to share your administrate.js pack? I am not well versed on asset management, so I just created a Rails 6.1.7 app to check, and mine looks like this:
So there's no |
What were you trying to do?
I want to destroy a record using the red "Destroy" link on the index view.
Instead it simply shows the record, as if a GET was sent instead of DELETE, and so there is no way to delete the record.
The text was updated successfully, but these errors were encountered: