-
Notifications
You must be signed in to change notification settings - Fork 330
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_frame_tag can no longer accept an array of ids #543
Comments
I see now in #476 it says:
So I suppose the plan is to enhance |
Thank you for exploring this @jwilsjustin!
@skipkayhil as the author of #476, I'm curious how you feel about rails/rails#44081 |
Thanks for responding @seanpdoyle. I don't know if rails/rails#44081 would fix this particular issue though since the dom_id method would still accept only one record (from what I can tell in that PR). But that PR could certainly serve as a starting point. |
👍 Based on Kasper's feedback it seems like the missing piece was a concrete need to make a change to
Right, to support multiple records passed to |
@skipkayhil @seanpdoyle AFAIK new features like this (supporting multiple models passed to dom_id) are not supposed to be suggested via GitHub issues in rails/rails. Could either of you direct me to where I should make such a suggestion? Or is an issue on the rails/rails repo the correct place to suggest this? |
If you want to discuss whether the change would be accepted, https://discuss.rubyonrails.org would be the place to go. Other than that there is not really any home for feature suggestion (by design). Instead of discuss, you can also just open a PR with the feature implemented. |
@skipkayhil Roger that. Thanks! I started a discussion. I'm going to see if I can get a PR going. Thank you for your helpful comments 💪 |
FWIW I made a PR that will allow us to pass an array of records or classes to the When or if that gets merged, I'm happy to make a PR here to make the necessary changes to support arrays passed to |
In version
1.4.0
theturbo_frame_tag
helper method accepted one or more ids or records.this:
would produce this:
There appears to be an issue in
1.5.0
where passing more than one id or record doesn't behave as expected.this:
is producing:
The regression appears to have been introduced in #476. The list of ids is getting "splatted" into the
ActionView::RecordIdentifier.dom_id
method: https://github.com/hotwired/turbo-rails/pull/476/files#diff-7694cf5e712468388f0d32c6638e9d9508b612f0346ce4beb9093960a757fa59R39But
ActionView::RecordIdentifier.dom_id
does not accept a collection: https://api.rubyonrails.org/classes/ActionView/RecordIdentifier.html#method-i-dom_idThe text was updated successfully, but these errors were encountered: