inertiajs/inertia-rails
59.1
Adequate · 20 September 2026
9.4k
lines of production code
TypeScript
with Ruby, JavaScript
1
measurement over time
What this system is
This system is the Inertia Rails adapter, a library that integrates the Inertia.js frontend framework with Ruby on Rails applications. It provides core functionality for rendering Inertia components, managing shared props with advanced caching and lifecycle modifiers, and handling server-side rendering via a managed Puma plugin. The system also includes comprehensive tooling for scaffolding, installation, and configuration across React, Vue, and Svelte frontends, ensuring type-safe and consistent project setups.
How it got here
2019 — library restructuring and feature expansion
13 changes.
The project underwent a significant restructuring, renaming the gem to inertia\_rails and consolidating its entry point while introducing advanced prop lifecycle modifiers and SSR capabilities. This period also involved stripping legacy integration components, updating documentation tooling, and establishing a comprehensive test infrastructure using a dummy Rails application to validate the new features.
2020–2024 — Generator modernization and framework support
18 changes.
This period focused on overhauling the installation and scaffolding generators to support modern frontend stacks, including React, Vue, and Svelte 5 with native TypeScript integration. The work introduced unified install tasks, updated templates to align with Inertia.js v3.5 conventions, and refactored the generator architecture to intelligently detect frameworks and package managers. Additionally, new scaffold generators and controller view templates were added to streamline the creation of Inertia-based Rails applications.
2025–2026 — Inertia SSR and TypeScript support
6 changes.
This period focused on enhancing Inertia Rails with automatic SSR process management via a Puma plugin and comprehensive TypeScript type definitions for React, Vue, and Svelte generators. It also introduced extension modules for improved request handling and error page rendering, alongside a robust suite of integration and generator tests to ensure reliability.
Features
Add TypeScript type definitions for Inertia flash data and shared props
The Svelte generator now includes a new \types\ directory containing TypeScript definitions that enable type-safe handling of Inertia flash messages and shared page props. Specifically, \globals.d.ts\ extends the Inertia configuration to recognize \FlashData\ and \SharedProps\, while \index.ts\ defines the structure for flash notices and alerts, ensuring developers get proper autocomplete and type checking for server-side flash data in their Svelte applications.
lib/generators/inertia/install/templates/svelte/types · high confidence
Add static controller for serving Inertia routes
A new \InertiaRails::StaticController\ has been added to handle Inertia requests. This controller inherits from a configurable parent controller (defaulting to \ActionController::Base\) and renders the specified Inertia component with props passed via the request path parameters. It includes a runtime check to ensure the parent controller inherits from \ActionController::Base\, raising an error if not, which prevents boot failures for applications that do not use Inertia routes.
app/controllers · high confidence
Added Inertia controller view templates for React, Vue, Svelte, and Tailwind CSS variants
New generator templates have been added for Inertia controller views, supporting React (JSX/TSX), Vue, and Svelte frontends. The standard templates provide basic scaffolding, while the Tailwind CSS variants include pre-styled headings with utility classes. These files enable the framework to scaffold controller-specific view components out-of-the-box for these specific frontend stacks.
_lib/generators/inertia\_templates/controller, lib/generators/inertia\_tw\templates/controller · high confidence
Added Inertia scaffold generators for standard and Tailwind templates
New scaffold generators have been introduced for Inertia.js-based Rails applications, including a core generator in \lib/generators/inertia/scaffold\ that integrates with Rails resource generation while removing default controller hooks, and template-specific generators in \lib/generators/inertia\_templates/scaffold\ and \lib/generators/inertia\_tw\_templates/scaffold\ that provide default view templates for standard and Tailwind CSS variants respectively.
_lib/generators/inertia/scaffold, lib/generators/inertia\_templates/scaffold, lib/generators/inertia\_tw\templates/scaffold · high confidence
Added Rake tasks for Inertia.js framework installation
Users can now install Inertia.js configurations for React, Vue, or Svelte front-ends directly via Rake tasks (e.g., \rake inertia\_rails:install:react\). These tasks act as wrappers that invoke the underlying \rails g inertia\_rails:install\ generator with the appropriate \--front\_end\ flag, streamlining the setup process for new projects.
lib/tasks · high confidence
Automatic SSR process management via Puma plugin
A new Puma plugin (\lib/puma/plugin/inertia\_ssr.rb\) is introduced to automatically manage the lifecycle of the Inertia SSR server. The plugin spawns the SSR process after Puma boots, monitors its health via a \/health\ endpoint, and automatically restarts it if it crashes or exits unexpectedly. It also handles graceful shutdown of the SSR process when Puma stops or restarts, and detects the runtime environment (Bun, Deno, or Node) and bundle location automatically.
lib/puma · high confidence
Generator templates now include TypeScript types for Inertia flash data
The React and Vue Inertia generator templates now ship with a \types\ directory containing TypeScript definitions. These files introduce \FlashData\ and \SharedProps\ types and augment the \@inertiajs/core\ module to provide type safety for flash notices and alerts, ensuring that generated projects have proper typing support for Inertia's shared page props and flash messages out of the box.
lib/generators/inertia/install/templates/react/types, lib/generators/inertia/install/templates/vue/types · high confidence
New extension modules for Inertia integration helpers and middleware patches
This change introduces four new extension modules in lib/inertia\_rails/extensions to enhance Inertia support within the Rails application. The InertiaMapper module extends the route mapper to support static props and improved component path resolution via the inertia helper. The InertiaRequest module adds convenience methods (inertia?, inertia\_partial?, inertia\_precognitive?) for detecting Inertia and Precognition headers. Additionally, patches for BetterErrors and ActionDispatch::DebugExceptions are provided to ensure that error pages render as HTML rather than plain text for Inertia requests, preserving the user experience during debugging.
_lib/inertia\rails/extensions · high confidence
New release tooling and updated development console
The repository now includes three new scripts to streamline the release process: \bin/resolve\_version\ calculates the next semantic version based on bump types or overrides, \bin/prepare\_publish\ automates version bumping, changelog updates, and test execution before tagging, and \bin/generate\_scaffold\_example\ creates a temporary Rails application with Inertia, Vite, and specified frameworks (React, Vue, Svelte) for testing. Additionally, the \bin/console\ script has been updated to use \rails/all\ and the \inertia\_rails\ gem directly, improving the local development experience for experimenting with the library.
bin · high confidence
New unified Inertia install generator with framework-specific scaffolding
The Inertia Rails adapter now includes a new \lib/generators/inertia/install\ generator that streamlines setup for React, Vue, and Svelte. This generator automatically detects the JavaScript package manager (npm, yarn, pnpm, or bun), installs the correct Inertia and Vite plugins for the chosen framework, and configures TypeScript support with appropriate type definitions and check scripts. It also handles framework-specific configurations, such as Svelte 5 setup, Tailwind CSS v4 integration, and Vite Ruby integration with automatic localhost redirection. The generator creates example pages and controllers for each framework, ensuring a consistent starting point for new Inertia applications.
lib/generators/inertia/install · high confidence
Removals
Removal of core Inertia Rails integration components
The Inertia Rails integration has been stripped of its essential runtime components, including the Controller, Inertia singleton, Middleware, Railtie, and Renderer. This change removes the ability to render Inertia pages, share data across actions, handle version-based page refreshes, and register the custom \:inertia\ render method within Rails controllers.
lib/inertia · high confidence
Behavioural changes
Consolidated library entry point with expanded prop and SSR support
The main library entry point (\lib/inertia\_rails.rb\) has been consolidated into a single file, replacing the previous split structure. This change introduces support for prop-level caching and various new prop types (lazy, optional, always, once, merge, cache, defer, scroll) alongside their associated resolvers. It also integrates Server-Side Rendering (SSR) capabilities, including a dedicated SSR renderer and meta tag builders, while maintaining core Rails integration through the controller, middleware, and engine.
lib · high confidence
Introduce prop lifecycle modifiers and refined meta tag handling
The library now supports granular control over prop evaluation and caching through new prop types: \InertiaRails.always\ (always included), \InertiaRails.defer\ (lazy loading with optional error rescue), \InertiaRails.once\ (evaluated only on the initial visit), \InertiaRails.merge\ (deep-merging with shared data), and \InertiaRails.optional\ (lazy and cached). Additionally, the \inertia\_share\ helper now accepts \:if\, \:unless\, \:only\, and \:except\ options to conditionally share data, and the meta tag system has been refactored to use a dedicated \MetaTag\ class that intelligently deduplicates tags and supports server-driven \serverHead\ output for Inertia.js v3.5+.
_lib/inertia\rails · high confidence
Project maintenance and configuration updates
This release includes several maintenance changes: a new \.rubocop.yml\ file is added to configure RuboCop (enabling new cops, excluding specific directories, and disabling Metrics and Style/Documentation), the legacy \.travis.yml\ CI configuration is removed, the \.gitignore\ is updated to exclude additional local and build artifacts (such as \.cache/\, \Gemfile.lock\, and dummy app logs), the \.rspec\ configuration is switched to require \rails\_helper\ instead of \spec\_helper\, the copyright year in \LICENSE.txt\ is updated to 2025, and the \Rakefile\ is expanded to include tasks for standard Ruby tests (\test\) and RuboCop linting, making them part of the default task.
(repo-wide) · high confidence
Refactor Inertia root element rendering
The Inertia view template now uses the \inertia\_root\ helper to render the application's root element instead of manually defining a div with a data attribute. This change standardizes how the initial page data is injected into the DOM, ensuring consistent rendering behavior across the application.
app/views · high confidence
Refactored generator architecture to support TypeScript and multiple frontend frameworks
The generator logic has been restructured into a base class hierarchy (ControllerTemplateBase and ScaffoldTemplateBase) with a shared Helper module, enabling consistent view generation for React, Vue, and Svelte. This change introduces native TypeScript support for scaffolds, automatically detecting TypeScript usage via tsconfig.json and generating .tsx, .ts.vue, or .ts.svelte files as appropriate. The generators now intelligently detect the frontend framework from package.json dependencies and handle versioning logic for template selection, ensuring that generated views match the project's specific framework and language configuration.
_lib/inertia\rails/generators · high confidence
Removal of version constant definition
The file defining the Inertia::Rails::VERSION constant has been deleted, meaning the library no longer exposes its version number through this specific module structure.
lib/inertia/rails · high confidence
Scaffold generator now uses Rails 8+ strong parameters API
The Inertia scaffold controller generator has been updated to support Rails 8. When generating controllers for Rails 8 applications, the generated code now uses \params.expect\ for strong parameters instead of the legacy \params.require(...).permit\ chain. This ensures generated scaffolds are compatible with the newer Rails API while maintaining backward compatibility for earlier Rails versions.
_lib/generators/inertia/scaffold\controller · high confidence
Updated Inertia.js generator templates and configuration
The Inertia.js installation generator has been updated to include new default templates and configuration options. A new example controller (\InertiaExampleController\) is now provided to demonstrate basic usage. The default initializer configuration has been updated to enable \server\_head\ for server-driven meta tags, \use\_script\_element\_for\_initial\_page\ for script-based initial page rendering, and \use\_data\_inertia\_head\_attribute\ for data-driven head attributes. Additionally, a new \dev\ script template is included to streamline local development by automatically selecting the best available process manager (overmind, hivemind, or foreman) to start the application.
lib/generators/inertia/install/templates · high confidence
Updated React installation templates with Inertia v3.5 defaults and new example page
The React installation templates have been updated to align with Inertia.js v3.5, enabling \serverHead\ for server-driven meta tags and setting \withAllErrors\ to true by default in form handling. The entrypoint configuration now uses \forceIndicesArrayFormatInFormData: false\ and \queryStringArrayFormat: "brackets"\. Additionally, a new \InertiaExample\ page (with CSS modules and TypeScript support) has been added to the generator, displaying framework version information and providing a starting point for Hot Module Replacement (HMR) testing.
lib/generators/inertia/install/templates/react · high confidence
Updated React scaffold templates for Inertia v3
The React scaffold generator templates have been updated to align with Inertia v3 conventions. The generated views now use a shared \Form\ component for create and edit pages, which handles field rendering and submission. The list and show pages now explicitly consume flash messages via \usePage().flash\ to display notices. Additionally, the TypeScript templates now import shared type definitions from a generated \types.ts\ file to ensure type safety across the scaffolded components.
_lib/generators/inertia\templates/scaffold/templates/react · high confidence
Updated React scaffold templates to use a shared Form component and display flash notices
The React scaffold templates (edit, new, index, show) have been refactored to use a dedicated Form component for handling resource creation and updates, replacing inline form markup. This change also introduces flash notice display in the index and show views via Inertia's usePage hook, and adds TypeScript type definitions for model and form data in the new types.ts template.
_lib/generators/inertia\_templates/scaffold/templates/vue, lib/generators/inertia\_tw\_templates/scaffold/templates/vue, lib/generators/inertia\_tw\templates/scaffold/templates/react · high confidence
Updated Svelte generator templates for Inertia.js v3.5 and Svelte 5
The Svelte installation templates have been updated to support Inertia.js v3.5 and Svelte 5. The Inertia client configuration now enables \serverHead\ for server-driven meta tags and sets \withAllErrors\ to true by default in form handling. The generated example components (\InertiaExample.svelte\ and \InertiaExample.ts.svelte\) have been modernized to use Svelte 5 syntax, including \$props()\ for component props and \\<svelte:head\>\ for document head management, while also displaying runtime version information for Rails, Ruby, and Svelte.
lib/generators/inertia/install/templates/svelte · high confidence
Updated Svelte scaffold templates with TypeScript support and Tailwind styling
The Svelte scaffold generator templates now include TypeScript variants (\.ts.svelte\ files) alongside the existing JavaScript versions, providing type definitions via a shared \types.ts\ template and using Svelte 5 \$props\ syntax for type safety. The Tailwind CSS variant templates have been updated to use utility classes for layout and styling, replacing the previous minimal CSS, and both variants now display flash notices from the Inertia \page\ object.
_lib/generators/inertia\_templates/scaffold/templates/svelte, lib/generators/inertia\_tw\templates/scaffold/templates/svelte · high confidence
Updated Vue scaffolding with Inertia v3.5 defaults and TypeScript support
The Vue installation templates have been updated to align with Inertia.js v3.5, enabling server-driven meta tags via the \serverHead\ option and changing the default form behavior to include all validation errors (\withAllErrors: true\) while disabling index-based array formatting (\forceIndicesArrayFormatInFormData: false\). The scaffolding now includes TypeScript entry points (\inertia.ts\) and configuration files (\tsconfig.json\, \tsconfig.app.json\, \tsconfig.node.json\) alongside the existing JavaScript versions, and provides a revamped \InertiaExample\ page template that displays framework version information and supports dark mode styling.
lib/generators/inertia/install/templates/vue · high confidence
Test coverage
Add minimalistic dummy Rails application for testing; Added Inertia integration tests and Minitest helpers; Added generator tests for controller and scaffold view paths; Added test fixtures for frontend framework detection and Vite configuration; Added test fixtures for install generator layouts; Added test infrastructure and configuration for the dummy Rails application; Added test layout views for Inertia SSR and meta tag integration; Added tests for generator helper framework and template detection; Added tests for the Inertia install generator; Expanded dummy controller test coverage for Inertia features; Expanded test coverage for InertiaRails core features and configuration.
Dependencies
Update documentation dependencies and rename gem to inertia\_rails
The documentation site now uses VitePress with new dev dependencies including VitePress 1.2.2, Mermaid 11.12.3, and various Prettier plugins. The gem has been renamed from 'inertia' to 'inertia\_rails' (inertia\_rails.gemspec), with the old inertia-rails.gemspec removed. The gemspec now requires Ruby \>= 3.0 and adds railties \>= 6 as a runtime dependency. Development dependencies in the Gemfile have been updated to support Rails 8.1 testing with specific version constraints for json (\< 3) and puma.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 59.
Lenses
- Code Health 65
- Architecture 93
- Maturity 73
- Readiness 48
- Security 75
- Accessibility 67
Changes since last survey
- 300 commits — 241 feature/other, 59 fixes
By area
- (repo) — 68 commits
- docs/guide — 57 commits
- lib/inertia_rails — 57 commits
- lib/generators — 45 commits
- (root) — 22 commits
- spec/dummy — 11 commits
- docs/awesome.md — 8 commits
- docs/.vitepress — 7 commits
- .github/workflows — 6 commits
- spec/inertia — 5 commits
- docs/public — 3 commits
- lib/patches — 3 commits
- docs/cookbook — 2 commits
- .devcontainer/Dockerfile — 1 commit
- app/controllers — 1 commit
- bin/generate_scaffold_example — 1 commit
- docs/package-lock.json — 1 commit
- lib/inertia_rails.rb — 1 commit
- spec/fixtures — 1 commit
Notable commits
- fix: Add a redirect to fix Vite on MacOS issue
- fix: Apply fixes from master
- fix: Fix ActionView::MissingTemplate for static controller
- fix: Fix Rails 8.2 (edge) compatibility for debug_exceptions patch
- fix: Fix Svelte versions
- fix: Fix TypeScript packages installed as dependencies instead of devDependencies (#376)
- fix: Fix URI() can't parse ipv6
- fix: Fix Vite plugin insertion order in install generator
- fix: Fix align issues for React Tailwind templates
- fix: Fix changelog bump & reverse failed bump commit (#366)
- fix: Fix cross-variant 304 poisoning under HTTP conditional caching (#383)
- fix: Fix debug_exceptions patch for Rails < 8.2 where Mime[:md] is nil
- fix: Fix error types
- fix: Fix external redirect handling for Inertia requests (#379)
- fix: Fix flaky test
- fix: Fix forceIndicesArrayFormatInFormData value for install generator
- fix: Fix generated controller view filename casing (#387)
- fix: Fix incorrect file references in TypeScript templates
- fix: Fix inertia routes helper option handling and endpoint resolution (#388)
- fix: Fix lint
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
inertiajs/inertia-rails was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b213e7a7f44734811ee9908b998b76f9774003a3 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.