← Graph

ViewComponent Checklist

takeaway 2 connections

Use a ViewComponent when: code is shared between two controllers; a view helper is generating more than ~2–3 lines of HTML; there's complicated conditional/presenter logic that deserves testing; you're about to copy-paste a repeating pattern; or the piece is wired to JavaScript (e.g. Stimulus). Keep partials for `_form.html.erb` (the same for new/edit). Keep view helpers for pure formatters like `format_money`. Don't extract components just to clean messy HTML — isolate the mess on one page until you know the right shape.

type
recommendation
takeaway ViewComponent Checklist
about
Criteria for deciding when a piece of UI becomes a ViewComponent.
takeaway ViewComponent Checklist
from_talk
Checklist explicitly presented during the talk.

Provenance

Read by
4 extractions