Draper Decorators
CommunityEnhance Rails views with clean, organized logic.
AuthorMadBomber
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill addresses the common challenge in Rails applications of keeping presentation logic out of models and controllers, leading to cleaner, more maintainable code.
Core Features & Use Cases
- Separation of Concerns: Implements the Draper gem to separate business logic (models) from presentation logic (views).
- View Helper Integration: Provides easy access to Rails view helpers within decorators.
- Association Decoration: Automatically decorates associated model objects.
- Context Passing: Allows passing contextual information (like the current user) to decorators.
- Use Case: When you need to format dates, combine names, or generate HTML snippets for display in a Rails view, this Skill guides you on how to encapsulate that logic cleanly within a decorator, rather than cluttering your models or controllers.
Quick Start
Use the Draper gem to create a decorator for your User model to format the full name.
Dependency Matrix
Required Modules
None requiredComponents
referencesexamples
💻 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: Draper Decorators Download link: https://github.com/MadBomber/experiments/archive/main.zip#draper-decorators 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.