Tubo Frames decompose your page in parts using tag <turbo-frame>, which can be replaced by copies received by the server, just locating and replacing them thanks to identifiers. For example we can manage a message in your list of messages annotating with this tag "_message.html.erb":
<%= turbo_frame_tag @message do %>
......
<%= link_to @messages, data: { turbo_frame: "_top" } %>
......
<% end %>
In this ERB code frame would be replaced inside the tags, but the link to all messages will be replaced in full body of HTML page. Here is the translation to HTML code:
<turbo-frame id="message_1">
......
<a href="/messages" data-turbo-frame="_top" />
......
</turbo-frame>
In controller we send only "_message.html.erb" rendered
def show
@message = Message.find(params[:id])
render @message
end
Eager-loaded frame: Replaced when "/messages" are loaded. Adding "src: @messages" to your ERB file.
Lazy-loaded frame: Content will be replaced when frame is visible. Add [loading: "lazy"]to ERB tag
Frame targets: manage where to be replaced
Advance/replace on browser history: By default takes replace strategy, but you can create copies: <turbo-frame data-turbo-action="advance">
Anti-forgery support (CSFF):
Several Frame attributes and JavaScript properties:
Check reference, they are very useful on development.