jr-rails-phlex
Installation
SKILL.md
Phlex Views & Components
Components are Ruby objects — no template language, no DSL. Views replace ERB templates (one per controller action). Components are reusable UI building blocks.
Core Workflow
- Use the scaffold generator — custom
PhlexControllerGeneratorproduces Phlex views instead of ERB. See reference/coding-phlex.md § Scaffolding for the full generator code and all 5 templates. - Implementation order — models → controllers → views/components → tests.
- Forms default to ERB partials — Rails form builders are ergonomic there. Phlex form helpers exist for simple cases.
Class Hierarchy
Components::Base < Phlex::HTML (include Components, route helpers, dev comments)
├── Views::Base (+ Debug, ContentFor, caching)
├── Components::Layout (+ Phlex::Rails::Layout)
Related skills