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

  1. Use the scaffold generator — custom PhlexControllerGenerator produces Phlex views instead of ERB. See reference/coding-phlex.md § Scaffolding for the full generator code and all 5 templates.
  2. Implementation order — models → controllers → views/components → tests.
  3. 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
Installs
22
GitHub Stars
26
First Seen
Mar 30, 2026