Menu

Turbo Frames don’t update the URL… unless you do this
📰

Turbo Frames don’t update the URL… unless you do this

DEV Community·Pavel Myslik·6 months ago
#vFWHMVvT
#rails#ruby#turbo#hotwire#webdev
Reading 0:00
15s threshold

Want to try it yourself? A full working demo is here: turbo-advance-vs-replace . Clone it, run bin/setup and follow DEMO.md for more tips.

Turbo Frames are one of the best things about Hotwire. Wrap a part of your page in <turbo-frame> , and navigations inside it become fast partial updates instead of full page reloads. No JavaScript, no API endpoints, just HTML.

But by default frame navigation:

doesn’t touch browser history

doesn’t change the URL

doesn’t create or replace entries

It just fetches HTML and swaps the frame content in place.

Most of the time, that’s perfect. But sometimes you want the URL to reflect state.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.