<% target = browser.device.mobile? ? nil : "details" %>
<%= link_to snip_path(snip), data: (target ? { turbo_frame: target } : {}) do %>
<%= snip.title %>
<% end %>
<%= turbo_frame_tag "details" do %>
<p>Select a snip to preview.</p>
<% end %>
Sometimes you want frame navigation on desktop but full-page navigation on mobile. You can decide the target frame at render time. This keeps UX tuned without duplicating controller actions.