
Building a Rails Engine #15 -- ERB Views Meet Phlex Components
ERB View Templates: Composing Phlex Components Phlex components are pure Ruby. ERB templates are what the browser actually sees. The glue between the two is a single method: .call . Context This is part 16 of the series where we build DataPorter , a mountable Rails engine for data import workflows. In part 9 , we built six Phlex components -- StatusBadge, SummaryCards, PreviewTable, ProgressBar, ResultsSummary, FailureAlert. In part 10 , we built the controller and routes. But we never connected the two. The engine has a fully wired backend and a complete component library, but visiting /imports crashes with ActionView::MissingTemplate . The app/views/data_porter/imports/ directory is empty. The controller sets instance variables, the components know how to render HTML, but there is no view template to orchestrate them. In this article, we create three ERB templates -- index, new, and show -- that compose the existing Phlex components into full pages. The missing attachment Before touc
Continue reading on Dev.to
Opens in a new tab



