- Home
- Skills
- Cole Robertson
- Inertia Rails Skills
- Inertia Rails Cookbook
inertia-rails-cookbook_skill
- Shell
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill cole-robertson/inertia-rails-skills --skill inertia-rails-cookbook- SKILL.md23.4 KB
Overview
This skill is a practical cookbook of recipes and patterns for building Inertia + Rails applications. It collects ready-to-use examples for starter kit customization, shadcn/ui integration, modal dialogs, search with filters, and common UI flows like wizards and slideover modals. The intent is to speed implementation and reduce boilerplate for real projects.
How this skill works
The collection inspects common Inertia Rails workflows and provides concrete code snippets for controllers, frontend pages (React/Vue), layout switches, and TypeScript types. It shows how to wire server-side rendering, flash toasts, modal pages (including history-aware base_url), shadcn/ui components, and search/sort/pagination with URL sync. Each recipe includes the minimal controller and frontend changes required to get a pattern working in the official starter kit structure.
When to use it
- When starting a new Inertia Rails app and customizing the official starter kit
- When adding a new resource (CRUD) and wiring routes, pages, and navigation
- When you need modal or slideover pages that integrate with browser history
- When integrating shadcn/ui components or adding new UI primitives
- When implementing server-driven search, filters, sorting, and pagination
Best practices
- Keep server responses minimal and return only required JSON fields for pages to reduce payload
- Use the provided starter kit layout patterns to swap sidebar/header layouts without refactoring pages
- Sync filter and sort state to the URL so results are bookmarkable and back/forward friendly
- Debounce search inputs on the client and use preserveState/replace options with router.get to avoid janky navigation
- Use inertia_modal base_url when opening modal pages to maintain proper browser history and deep links
Example use cases
- Add a Products resource: generate controller, create pages, update nav, and add routes
- Render a create form as a modal with @inertiaui/modal so the URL updates and the back button closes the modal
- Use shadcn/ui Card, Input, and Button to build polished login and profile forms wired to useForm
- Implement a users table with server-side search, sortable columns, and pagination that updates the URL
- Build nested modals or slideover details for record editing without leaving the list page
FAQ
Yes. Recipes show the starter kit structure for React and include modal and shadcn/ui guidance for both Vue and React where applicable.
How do I make modal pages update the browser URL?
Use the inertia_modal render option on the controller with a base_url and open the page via ModalLink with navigate enabled so history is updated.