Pagination links that escape a Turbo Frame with _top

3286
0

Sometimes a frame is great for partial navigation, but sometimes you explicitly want a full-page visit. Pagination is a common case: when the page number changes, I often want the URL to update and the browser history to behave normally. You can tell Turbo to navigate the top-level frame by setting data-turbo-frame='_top' on the pagination links. This is a simple escape hatch that avoids weird nesting (like a frame within a frame) and makes the page’s canonical URL match the content. I use this for filters too: quick interactions can stay in a frame, but “big” navigation updates the whole page. It’s a tiny attribute that saves a lot of confusion.