API-only, meet Hotwire

HTML over the wire

Every module so far talked to PawWalk through JSON β€” render json: ..., a mobile client parsing the response. Hotwire is a different way to build a UI: instead of a client-side app that fetches JSON and re-renders itself, the server sends real HTML, and a small JS layer makes that HTML behave like an app. No build step, no bundler, no client-side state to keep in sync with the server β€” the server IS the source of truth, on every request.

Hotwire is three pieces working together. Turbo Drive intercepts normal link clicks and form submits, fetches the new page in the background, and swaps in just the <body> β€” so navigation feels instant without a full page reload, and without writing a client-side router. Turbo Frames scope a navigation to one region of the page (lesson 2). Turbo Streams let the server push small HTML updates to a page that's just sitting open (lesson 3). Stimulus (lesson 4) is the sprinkle-of-JS layer for the few things HTML alone can't do, like a confirm dialog.