viewcomponent-patterns
Installation
SKILL.md
ViewComponent Patterns for Rails 8
Overview
ViewComponents are Ruby objects for building reusable, testable view components:
- Faster than partials (no partial lookup)
- Unit testable without full request cycle
- Encapsulate view logic with Ruby
- Type-safe with explicit interfaces
Quick Start
# Add to Gemfile
bundle add view_component
# Generate component
bin/rails generate component Card title