What problem does it solve?
Inertia Rails provides a hybrid approach that lets Rails handle server-side routing and data fetching while React renders client-side views via Inertia, eliminating the need for a heavy SPA setup or traditional SSR.
Core Features & Use Cases
- Inertia responses and props: server returns a component name and props as JSON, enabling smooth client-side rendering without full page reloads.
- Redirects and forms: manage form submissions and redirects through inertia: responses, keeping user flow coherent.
- Page-based architecture: organize components under app/frontend/pages/ControllerName/ActionName for clear routing to React pages.
Quick Start
Initialize a Rails project with inertia-rails, add the gem, create a basic page under app/frontend/pages, and render inertia: { component: 'Example', props: { ... } } from a controller action.