Hey @ogmiosnetworks, not directly, no. You can’t get the benefits of turbo_frame (how links open inside them if the next page has the same frame, etc) just with data attributes.
But one thing you can do is to update elements by id
indirectly. And that’s by getting <turbo_stream action="replace" target="<dom_id_of_what_to_replace">
elements to land on your page.
This adds some interaction, and it could all be handled via a turbo_frame
that’s not visible on the page. The way this works is that turbo watches the DOM for new and modified elements. One of the elements it watches out for is the <turbo_stream>
element. They can have different actions, like append
(a child to a parent collection of a certain id
), or replace
.
It’s useful for managing rows of a table since you can’t wrap <tr>
's with turbo_frame
elements.
It’s also useful for updating form sections. See this other thread for updating form sections.
Hope that gives you an extra option!