Turbo Streams fallback to HTML for older clients

5478
0

Even in a Hotwire-first app, I keep HTML fallbacks because it makes features robust and keeps endpoints usable for bots and scripts. In controllers, I almost always include format.html alongside format.turbo_stream. For example, on create I return turbo streams for in-place updates, and I redirect for HTML. The response templates can share partials, so you’re not duplicating markup. This also makes it easier to test: request specs can hit HTML responses without worrying about JS. The “fallback” mindset leads to better design: pages remain navigable, forms remain standard, and your Hotwire layer feels like enhancement rather than a parallel app. It’s one of the biggest reasons I prefer Hotwire over a custom SPA for many products.