layouts-and-rendering
OfficialMaster Rails views: layouts, partials, and rendering.
AuthorThinkOodle
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides expert guidance to ensure your Rails application renders views correctly, efficiently, and with the appropriate HTTP responses, preventing common errors like "double render" and ensuring seamless integration with Turbo/Hotwire.
Core Features & Use Cases
- Render vs. Redirect: Clearly distinguishes between
renderandredirect_tofor correct request handling. - Partials & Locals: Enforces best practices for partials, emphasizing explicit local variable passing to avoid coupling.
- Layout Management: Covers layout selection, inheritance, and nested layouts.
- Turbo/Hotwire Status Codes: Ensures correct HTTP status codes (
422,303) for Turbo-aware responses. - Use Case: When building a form that can be edited or created, this Skill helps you correctly handle both successful submissions (redirecting with
303) and validation errors (re-rendering the form with422), ensuring a smooth user experience with Turbo.
Quick Start
Use the layouts-and-rendering skill to correctly render a form with validation errors, ensuring the form data is preserved and the correct HTTP status code is used.
Dependency Matrix
Required Modules
None requiredComponents
scriptsreferences
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: layouts-and-rendering Download link: https://github.com/ThinkOodle/rails-skills/archive/main.zip#layouts-and-rendering Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.