inertia-rails avatar

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-code

Installs 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_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

Sponsors

Details

Repository
github.com/inertia-rails/skills
Categories
Security, Git & Pull Requests, Documentation, Finance & Trading, PHP & Laravel
First seen
Jun 3, 2026

More from inertia-rails/skills

All 9

Recommended

More Security
1sivaprasadreddy avatarspring-boot-skillsivaprasadreddy/sivalabs-agent-skillsBuild Spring Boot 4.x applications following the best practices. Use this skill: * When developing Spring Boot applications using Spring MVC, Spring Data JPA, S493skills.sh installs
2atlassian avatarsearch-company-knowledgeatlassian/atlassian-mcp-serverSearch across company knowledge bases (Confluence, Jira, internal docs) to find and explain internal concepts, processes, and technical details. When an agent n488skills.sh installs
3aj-geddes avatarzero-trust-architectureaj-geddes/useful-ai-promptsImplement Zero Trust security model with identity verification, microsegmentation, least privilege access, and continuous monitoring. Use when building secure c487skills.sh installs
4aj-geddes avatarincident-response-planaj-geddes/useful-ai-promptsCreate and execute incident response procedures for security breaches, data leaks, and cyber attacks. Use when handling security incidents, creating response pl484skills.sh installs
5alirezarezvani avatarship-gatealirezarezvani/claude-skillsPre-production audit that scans a codebase for security, database, deployment, code quality, AI/LLM, dependency, frontend, and observability issues. Intercepts 483skills.sh installs
6parcadei avatarreleaseparcadei/continuous-claude-v3Release preparation workflow - security audit → E2E tests → review → changelog → docs483skills.sh installs