
Inertia Rails Controllers
This covers the Rails controller side of Inertia.js apps, focusing on the patterns that trip people up. The big one: instance variables don't automatically become props unless you're using alba-inertia, so you have to explicitly render inertia with a hash of data. It walks through prop types like defer (for slow queries that load after initial render), optional (for partial reloads), and once (for reference data). The external redirect trap is good to know: redirect_to breaks for Stripe or OAuth callbacks because Inertia tries to parse the 302 as JSON, so you need inertia_location instead. Also covers shared data setup, flash message config, and validation error handling with errors.to_hash instead of full_messages so your frontend can map errors to form fields.
- skills.sh installs
- 496
- GitHub stars
- 70
- last updated
- Aug 21, 2026
Install
$ npx -y skills add inertia-rails/skills --skill inertia-rails-controllers --agent claude-codeInstalls into .claude/skills of the current project.
Files
Inertia Rails Controllers
Server-side patterns for Rails controllers serving Inertia responses.
Before adding a prop, ask:
- Needed on every page? →
inertia_sharein 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
Sponsors
Details
- Repository
- github.com/inertia-rails/skills
- Categories
- Security, Git & Pull Requests, Documentation, Finance & Trading, PHP & Laravel
- First seen
- Jun 3, 2026