Ask A Question

Notifications

You’re not receiving notifications from this thread.

Hotwire turbo stream update_or_[append/prepend] ?

Miguel Michelson Martinez asked in Rails

Given a list of items that could be visible or not on a page (like a paginated list ), how is the best way to send from the server an update or append to that list? I Mean, update element when the item exists. If the element is not in view then append it.

  • I'm thinking of doing two calls: a turbo stream remove first and then turbo steam append.
Reply

Oh, I just realized that this was already solved in turbo, https://github.com/hotwired/turbo/pull/240

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.