
Hotwire vs Inertia.js: Which One Should You Use in Rails?
For a long time, if you wanted to build a fast, modern web application without page reloads, you had to build two completely separate apps. You had to build a Rails API for the backend, and a React or Vue Single Page Application (SPA) for the frontend. Very often I found myself tired of this approach. Managing JSON responses, CORS issues, and duplicating routing logic is just annoying. Thankfully, the industry realized this was too complex for solo developers. Two massive solutions appeared to fix this: Hotwire (created by the Rails team) and Inertia.js (popularized by the Laravel community). Both of these tools let you build modern "SPA-like" apps without building an API. But they work in very different ways. Here is my breakdown of how they compare, and why I personally favor Hotwire. The Inertia.js Approach (The Modern Monolith) Inertia.js acts as a glue between your backend (Rails/Laravel) and your frontend (React/Vue/Svelte). With Inertia, you still use Rails for your routes and c
Continue reading on Dev.to Webdev
Opens in a new tab


