Beta: This generator will replace the built-in
rails generate inertia_rails:installcommand in a future release of inertia_rails.
Interactive Rails application template for setting up Inertia Rails with React, Vue, or Svelte.
You can choose between two setup paths:
- Foundation — a modular setup where you pick features individually (TypeScript, Tailwind, shadcn, ESLint, SSR, and more).
- Starter Kit — a batteries-included app with authentication, dashboard, settings pages, dark mode, and sidebar/header layouts (similar to Laravel Breeze).
Create a new Rails app with Inertia pre-configured:
rails new myapp -m https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rbRun the generator against an existing Rails app. It auto-detects your framework, TypeScript, Tailwind, Vite, and package manager:
rails app:template LOCATION=https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rbSet environment variables to skip prompts. This is useful for CI and scripting:
INERTIA_FRAMEWORK=react \
INERTIA_STARTER_KIT=1 \
rails new myapp -m https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rbPick individual features for your project. The following options are available:
| Option | Env variable | Values | Default |
|---|---|---|---|
| Framework | INERTIA_FRAMEWORK |
react, vue, svelte |
react |
| TypeScript | INERTIA_TS |
1 / 0 |
prompted |
| Tailwind CSS v4 | INERTIA_TAILWIND |
1 / 0 |
prompted |
| shadcn/ui | INERTIA_SHADCN |
1 / 0 (requires Tailwind + TS) |
prompted |
| ESLint + Prettier | INERTIA_ESLINT |
1 / 0 |
prompted |
| SSR | INERTIA_SSR |
1 / 0 |
prompted |
| Typelizer | INERTIA_TYPELIZER |
1 / 0 |
prompted |
| Alba serializers | INERTIA_ALBA |
1 / 0 |
prompted |
| Test framework | INERTIA_TEST_FRAMEWORK |
minitest, rspec |
minitest |
Foundation generates a welcome page with a HomeController and a root route
to get you started.
The Starter Kit forces TypeScript, Tailwind, shadcn/ui, ESLint, SSR, and Typelizer on, and adds full authentication:
INERTIA_FRAMEWORK=react INERTIA_STARTER_KIT=1 \
rails new myapp -m https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rbThe Starter Kit includes:
- Authentication (register, login, forgot/reset password, email verification)
- Dashboard with sidebar and header layout variants
- Settings pages (profile, password, email, appearance, sessions)
- Dark mode with system/light/dark preferences
- Controller and mailer test suites (Minitest or RSpec)
- Alba + Typelizer for typed serializers (optional)
Pre-built starter kit apps are also available as standalone repos:
Both setup paths share the following features:
- Auto-detection — detects existing Vite, framework, TypeScript, Tailwind, and package manager in existing apps
- Package managers — npm, yarn, pnpm, and bun
- Conflict cleanup — removes
importmap-rails,turbo-rails, andstimulus-railsin fresh apps. Blocks ifjsbundling-railsorcssbundling-railsare present (they conflict with Vite) - Vite Ruby — configured with HMR, SSR support, and framework-specific
plugins (
@vitejs/plugin-react,@vitejs/plugin-vue,@sveltejs/vite-plugin-svelte) - shadcn/ui — React (shadcn), Vue (shadcn-vue), Svelte (shadcn-svelte)
- Dockerfile — generates a production Dockerfile with Node.js, your
package manager, and SSR support when
--dockeris used - CI workflow — generates a GitHub Actions workflow with lint, type check,
and test jobs. Adds a separate
lint_jsworkflow for existing apps - Dependabot — adds the
npmecosystem to your existing.github/dependabot.yml Procfile.devandbin/dev— starts Vite dev server alongside Rails
You can combine the generator with standard rails new flags:
# PostgreSQL + Docker
rails new myapp --database=postgresql --docker \
-m https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rb
# With devcontainer
rails new myapp --devcontainer -m https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rb
# Skip default Rails extras
rails new myapp --skip-action-mailbox --skip-action-text \
--skip-active-storage -m https://raw.githubusercontent.com/inertia-rails/generator/dist/template.rbFor existing apps, the Foundation path is recommended. If you need authentication, add authentication-zero separately after running the generator.
Install dependencies and run the default task (compile, test, lint):
bundle install
bundle exec rakeRun the end-to-end tests. These are slow because each test runs rails new:
bundle exec rake test:e2eGenerate starter kit apps locally:
bundle exec rake starter:react # tmp/react-starter-kit/
bundle exec rake starter:vue # tmp/vue-starter-kit/
bundle exec rake starter:svelte # tmp/svelte-starter-kit/
bundle exec rake starter:all # all threeRun the detect + prompts phase without making changes (useful for debugging):
bundle exec rake detect # against a fresh app
bundle exec rake detect APP=path/to # against an existing appTest a specific matrix of configurations:
ruby test/matrix_test.rb # Round 1: 6 configs
ruby test/matrix_test.rb --round 2 # Rounds 1-2: 15 configs
ruby test/matrix_test.rb --round 5 # All rounds: 27+ configs
ruby test/matrix_test.rb --only react_max # Re-run one configMIT