Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

inertia-rails

> 编程语言
Open source

The Rails adapter for Inertia.js.

1.2K stars0 likes2 views
WebsiteGitHub

About

The Rails adapter for Inertia.js.


Your controllers. Your routes. Modern components.

Inertia lets you build a fully client-side rendered single-page app without the complexity of a separate API. Pass data from Rails directly to React, Vue, or Svelte as props — no REST endpoints, no GraphQL, no client-side data fetching, no state-management headaches.

ruby
# app/controllers/users_controller.rb
class UsersController  (
  <>
    {users.map((user) => (
      

    ))}
  
)

export default Users

That's the whole loop: the controller returns props, the component renders them. Links and form submits are intercepted and turned into XHR visits, so navigation feels instant — but you're still writing plain Rails on the server.

Get started

Add to an existing Rails app — the installer sets up Vite, your chosen framework, and example pages:

bash
bundle add inertia_rails
bin/rails generate inertia:install

Or start from a kit with authentication, Vite, optional SSR, and Kamal deployment already wired up:

  • React Starter Kit — React 19 · TypeScript · shadcn/ui
  • Vue Starter Kit — Vue 3 · TypeScript · shadcn-vue
  • Svelte Starter Kit — Svelte 5 · TypeScript · shadcn-svelte

Full walkthrough: Server-side setup and Client-side setup.

Built for real Rails apps

Forms that work Validation errors flow from Rails to your components automatically — no manual wiring.
Server-side rendering Full SSR 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, permissions — available on every page automatically.
Deferred props Load the page fast, fetch expensive data after, with built-in loading states.
Rails generators Scaffold entire CRUD interfaces — controllers with matching components.
History encryption Keep sensitive data private, even in browser history. Toggle per page.

Why Inertia?

Inertia sits between traditional server-rendered apps and full SPAs.

vs. Hotwire — Same monolith, different view layer. Both keep you in Rails; Inertia gives you the full React/Vue/Svelte component model and the npm ecosystem instead of HTML-over-the-wire. Choose Hotwire for minimal JS and server-rendered HTML; choose Inertia for a modern component architecture.

vs. API + SPA — Same frontend, no API hassle. Both give you React/Vue/Svelte, but Inertia removes the API layer entirely: one router (Rails), Rails sessions instead of a JWT/OAuth dance, and props from your controller instead of fetching in useEffect. Choose an API for public/mobile clients; choose Inertia for focused web products. (You can always add an API alongside Inertia later.)

See the full comparison and FAQ →

Documentation

Everything lives at inertia-rails.dev:

  • How it works
  • Pages & layouts
  • Forms & validation
  • Shared data · Partial reloads · Deferred props
  • Server-side rendering
  • Testing
  • Configuration reference

Community

  • Awesome Inertia Rails — gems, tutorials, and real-world apps
  • Discord — ask questions, get answers fast
  • GitHub Discussions & Issues — browse the source, report bugs

Contributing

Bug reports and pull requests are welcome. To run the test suite:

bash
bundle install
bundle exec rspec

See the Code of Conduct. Everyone interacting with the project is expected to follow it.

Credits

Inertia Rails is part of the official Inertia.js organization. It was originally created by the team at bellaWatt and is maintained by the Inertia.js community.

Released under the MIT License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言