Skip to content
inertia-rails avatar

Inertia Rails Controllers

Rails controller patterns for Inertia.js covering render inertia, prop types, shared data, flash, and validation errors.

CCM score
60 of 100
skills.sh installs
505
GitHub stars
72
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers render inertia: data passing, prop types (defer, optional, merge, scroll, once), shared data, flash, and PRG redirects
  • Enforces inertia_location for external URLs (Stripe, OAuth) and errors.to_hash(true) for field-mapped validation errors
  • Warns that instance variables are not auto-passed as props without the alba-inertia gem, and that default_render: true alone sends no data
  • Designed for Rails controllers that load records or serve Inertia responses to React or other Inertia front ends

Install

$ npx -y skills add inertia-rails/skills --skill inertia-rails-controllers -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Inertia Rails Controllers

Server-side patterns for Rails controllers serving Inertia responses.

Before adding a prop, ask:

  • Needed on every page? → inertia_share in a base controller (InertiaController), not a per-action prop
  • Expensive to compute? → InertiaRails.defer — page loads fast, data streams in after
  • Only needed on partial reload? → InertiaRails.optional — skipped on initial load
  • Reference data that rarely changes? → InertiaRails.once — cached across navigations

Details

Repository
github.com/inertia-rails/skills
Categories
Backend & APIs, Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the inertia-rails-controllers skill do?

inertia-rails-controllers gives patterns for Rails controllers that serve Inertia.js responses, covering render inertia, prop types such as defer, optional, merge and scroll, shared data, flash messages, redirects and validation errors. It tells the agent to pass data explicitly with render inertia rather than relying on instance variables. It also says external URLs such as Stripe or OAuth must use inertia_location instead of redirect_to.

How do I install the inertia-rails-controllers skill?

Run npx -y skills add inertia-rails/skills --skill inertia-rails-controllers -y in your project. After that, inertia-rails-controllers guides the agent when it writes controllers that load data, display records or serve Inertia responses.

Where does inertia-rails-controllers fit among Backend & APIs skills?

inertia-rails-controllers is listed under Backend & APIs on Claude Marketplaces, alongside entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. Its focus is narrower than those, covering only Rails controller patterns for Inertia responses. It is part of the inertia-rails/skills repository.

Does inertia-rails-controllers pass instance variables to the frontend automatically?

No, inertia-rails-controllers warns that instance variables are not passed as props unless the alba-inertia gem is configured. Every action that sends data to the page must call render inertia with that data. Empty actions are only correct for pages that need no data.

More from inertia-rails/skills

All 9

Similar to Inertia Rails Controllers

More Backend & APIs