Build frontend experiences with the backend you love
Build single-page applications using your existing Rails controllers, routes, and authentication. No API required.
class UsersController < ApplicationController
def index
render inertia: {
users: User.active.map do |user|
user.as_json(only: [:id, :name, :email])
end
}
end
endimport { Link } from '@inertiajs/react'
const Users = ({ users }: { users: User[] }) => (
<>
{users.map((user) => (
{user.name}
{user.email}
))}
>
);
export default Users;class UsersController < ApplicationController
def index
render inertia: {
users: User.active.map do |user|
user.as_json(only: [:id, :name, :email])
end
}
end
endimport { Link } from '@inertiajs/react'
const Users = ({ users }: { users: User[] }) => (
<>
{users.map((user) => (
{user.name}
{user.email}
))}
>
);
export default Users;Your controllers. Your routes. Modern components.
Pass data from Rails directly to React, Vue, or Svelte as props. No REST endpoints. No GraphQL. No state management headaches.
Get started
Add to your existing Rails app or jump in with a ready-to-use starter kit.
bundle add inertia_railsbin/rails g inertia:installBuilt for real Rails apps
Form handling, SSR, testing helpers, and more. Everything you need to ship production apps with confidence.
Forms That Work
Validation errors flow from Rails to your components automatically. No manual wiring.
Server-Side Rendering
Full SSR support for SEO and fast first-paint. Your React/Vue/Svelte, rendered on Rails.
Test Like Rails
RSpec and Minitest matchers that feel native. Assert on props, components, and more.
Partial Reloads
Refresh only the data you need. Keep interactions snappy without full page loads.
Shared Data
Current user, flash messages, permissions. Available on every page automatically.
Deferred Props
Load the page fast, fetch expensive data after. Built-in loading states included.
Rails Generators
Scaffold entire CRUD interfaces. Generate controllers with matching components.
History Encryption
Sensitive data stays private, even in browser history. Toggle per-page.
Why Inertia?
Inertia sits between traditional server-rendered apps and full SPAs. Here's how it compares.
Same monolith, different view layer
Both keep you in Rails. Inertia gives you the full React/Vue/Svelte ecosystem.
Hotwire for minimal JS and server HTML.
Inertia for modern component architecture.
Same frontend, no API hassle
Both give you React/Vue/Svelte. Inertia removes the API layer entirely.
API + SPA for public APIs or mobile apps.
Inertia for focused web products.
Frequently asked questions
Common questions about using Inertia with Rails.
No. Controllers pass data directly to components as props—no endpoints, no client-side fetching. Need a public API later? Add it alongside Inertia whenever you want.
Yes. Devise, Clearance, custom auth—whatever you use today works unchanged. Inertia uses Rails sessions, so there's no token management to deal with.
SSR gives you fast first paint and full SEO. It runs a small Node.js process alongside Rails—the starter kits set this up for you.
Yes. ERB views and Inertia pages coexist fine. Convert one page at a time. No big-bang rewrite required.
No. Inertia started in the Laravel ecosystem, but this adapter is actively maintained and works the same way.
Wrap your Inertia app with Capacitor for native mobile/desktop—no API needed. Or add API endpoints alongside Inertia—they work fine together.
Yes. Partial reloads, code splitting, and deferred props keep large apps fast. Load only what you need, when you need it.
Join the community
Get help, share what you're building, and learn from real-world Inertia Rails applications.