-
Notifications
You must be signed in to change notification settings - Fork 328
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
turbo_stream.remove not removing entity #50
Comments
I think you can get it to work if you remove the stimulus controller and just use |
By doing a remote link that's triggering a fetch outside of Turbo, you're not going to be sending an Accept header that includes turbo stream. So you'll be hitting either the html or json formats. What @j-sieg said is the way to go. It's better for a11y to use real forms for actions anyway. |
Is a
Then you have to provide a blank |
Yeah, going to come up with a way to fix this. Right now you do need that empty response. You can also do |
I'm trying to get started with
turbo-rails
. I am attempting to create a small sample application and ran into a problem, I can't seem to getturbo_stream.remove
to actually remove an item from my html.The key bits are below
I have the following in my
index.html.erb
:the user (
_user.html.erb
) partial looks like this:Because
turbo-rails
doesn't currently supportdata-method
, I have the following piece of code in my stimulus controller to handle the delete link:My destroy action looks like this:
and my
destroy.turbo_stream.erb
looks like thisI can see that the turbo_stream template gets rendered when the
DELETE
call is made by looking at the rails server logs, but but the html is never updated, and I can't quite understand what I'm missing (or maybe this use case isn't supported).Another curious bit is that if I look at the network tab, the request returns a 200 but the response body is blank for the call. If I follow the request through rack and rails middleware, I can see the body being set correctly, so I have no idea where it is getting dropped.
Should this work? Or have I missed something completely obvious?
Here is a link to the example app if that would be helpful: https://github.com/tgturner/diceroll
The text was updated successfully, but these errors were encountered: