Phlex on Rails

Build amazing user interfaces in Rails with Phlex 💪

Tired of Rails frontends that feel brittle and messy? Bring back the joy with Phlex. In this course you'll learn how to:

  • Build ambitious frontends. Snap together fast, complex UIs without getting bogged down by partials, helpers, views, & bloated JS frameworks.
  • Work with existing Rails apps. Integrate Phlex components at your own pace without rewriting everything.
  • Level up your architecture. Create self-permitting forms, stateful views, and component-only apps that are easier to test, organize, & scale.

Whether you're leading a team or building your first app, you'll learn how to ship frontends that feel great to use and even better to build.

Meet your guide, Brad Gessler

I built my first large Rails app when I founded Poll Everywhere. What started as a side project grew into a platform used by millions and trusted to handle billions of responses.

As CTO, I led a team of 35 Rails developers, designers, and product managers. You'll learn from the many mistakes I made along the way, so you can build clean, scalable frontends that work for your team and your organization.


Here's the lesson plan 🧑🏻‍💻

Unit 1

Getting started

This course will teach you the tactics and strategies for building user interfaces with Phlex, Rails, and other tools. In addition to the mechanics of Phlex, we’ll take a step back and ask “Why” and “How will this improve the development workflow?”

Unit 2

Component fundamentals

Phlex components are self-contained Ruby classes of a user interface that can be “snapped” together to build a more consistent, higher quality user experience. We’ll explore how you can use the full power of the Ruby programming languages to compose UIs for your Rails application.

Unit 3

Existing Rails apps

Phlex components can gradually be built and rolled-out in Rails apps with Erb, Haml, Slim templates and ViewComponents. These videos will show how to install Phlex into an existing Rails app, how to organize view files, and give you a strategy to gradually migrate your views into Phlex components.

8:40

Getting Started

The first thing you need to do to get Phlex up and running in your Rails app is to install it.
9:52

Components

Phlex provides convenient generators that create new view components in your Rails projects, automatically placing them in the correct directories with proper namespacing.
16:04

Rendering from templates

The beauty of Phlex components is that they can be rendered within your existing ERB, Haml, or Slim templates, making it possible to incrementally introduce Phlex into your application without requiring a complete rewrite.
17:04

Helpers

One of the more confusing concepts when getting started with Phlex is understanding how helper functions work. Unlike Rails helpers, Phlex helpers don’t leak state, which is beneficial for maintainability, but it does create a slight learning curve for Rails developers.
13:12

Staying organized

As your Phlex application grows, maintaining a clean and logical organization becomes crucial for long-term maintainability. This section covers best practices for organizing your components and views to keep your codebase scalable and easy to navigate.
11:28

Views

Phlex views serve as the main templates for your Rails application, corresponding directly to controller actions. Unlike components, which are reusable UI elements, views represent complete pages or sections that are rendered when users visit specific routes in your application.
26:12

Layouts

In Rails applications, layouts are typically defined in seperate files and “wrap” a view via some sort of yield block.
6:00

Caching

Phlex is impressively fast, rendering HTML at approximately 1.4 GB/s per core on a MacBook Pro (M3 Max) without performance degradation as you extract more components. Despite this performance, there are still scenarios where view caching can provide additional benefits.
15:36

Action Mailer

Phlex components excel at creating email templates, though email styling requires a different approach due to the limitations and inconsistencies of email clients. Unlike web browsers, email clients have varying levels of CSS support, making inline styles the most reliable approach.

Unit 4

Build forms with components

Forms are a critical part of web applications, but they’ve traditionally been difficult to customize in Rails, especially with Phlex. Superform is a powerful form builder library built completely on Phlex that makes it possible to build different types of forms in your apps and use them with ease.

Unit 5

Phlex and Hotwire

Phlex components encapsulate views and fragments making them a perfect way to organize and compose views in the Turbo stack. Use them with Turbo Frames, Turbo Streams, and Turbo Pagemorphs and create a more responsive user interface.

9:04

Overview

Hotwire is a framework for building fast and responsive web applications.
8:12

Stimulus ERB to Phlex components

If you’re coming in from an existing Rails application, you may have a lot of Stimulus controllers that you want to convert to Phlex components. In this video, we’ll extract some existing ERB with Stimulus controllers and convert them to Phlex components.
10:56

Seperating Stimulus Concerns

How can the Stimulus controller behavior be extracted into a separate component so it can be reused across the application?
7:28

Implement Stimulus Component in ERB

Once Stimulus controller behavior is extracted into a separate component, we’ll apply it into an ERB template.
7:12

Stimulus Base Component

Basic Stimulus functionality can be extracted into a separate component so it can be reused across the application.
10:16

Turbo Frame DOM IDs

Turbo Frames, Streams, and Broadcasts all revolve around having a specific DOM ID so it knows what content to replace on the page. We’ll implement a highly specific dom_id method on components that can be used to identify themselves.
11:52

Turbo Broadcast

Integrate Phlex components into your Turbo broadcasts.
3:04

Turbo Broadcast Extraction

Since Phlex views are objects, they can be integrated with Turbo Broadcast in a more intuitaive way. Consider this User model that updates an account dashboard with the lastest stats.
10:56

Turbo Pagemorphs

I always recommend starting with Turbo Pagemorphs before bothering with Turbo Streams or Turbo Frames. Turbo Pagemorphs are the simplest way to add interactivity to your Rails application. They also work best with components.

Unit 6

Styling with CSS & utility frameworks

Components work great with CSS utility Frameworks, like Tailwind CSS. We’ll install Tailwind CSS in a Rails app and integrate it with Phlex components

Unit 7

Pure Phlex Rails apps

Go all-in on Phlex and build a Rails app completely out of Phlex components. You might not take it this far, but seeing it in action is a great way to understand how layouts, views, controllers, and components work together to create elegant UIs.


Invest in yourself 🤗

Pay once for lifetime access to the video course. No subscription required.

Purchase video course for $379 $329

Launch pricing: 13% off to help you start building better Rails UIs today. 🚀

  • Ship fast, quality UIs in Rails with Phlex and Hotwire. No React, no build step, no client-side bloat
  • Build self-permitting, reusable forms with full control over markup and behavior using Superform
  • Gradually upgrade existing Rails apps with Phlex components at your own pace
  • Replace tangled ERB, Haml, or Slim views with clean, composable Phlex components
  • Create component-only Rails apps that eliminate templates, partials, and helpers
  • See how components improve architecture, reusability, speed, and testability
  • 7+ hours of video across 45 lessons in 7 focused units
  • Lifetime access to all future updates and lessons

Launch discount 🤘🚀

Join the early wave of developers pushing Rails frontends forward. $50 off launch pricing.

  • Seed supporter

    The first 50 people who order will get to work with Brad to shape the direction of the course.

    Completed July 2025



  • Early adopter

    Get emails as soon videos are published and give feedback on the course.

    Completed October 2025



  • Launch

    The course will be discounted for the grand opening! Get a $50 discount off the full price of the course.

    Purchase video course


  • Mainstream

    Course is fully published and full price.


Custom team workshops ⛹️‍

Bring consistency, speed, and confidence back to your Rails frontend

Rails apps often evolve into a mix of UI patterns and frameworks. The result is uneven quality, slower releases, and teams that hesitate to make changes. Phlex gives teams a unified way to build UI in Rails. It improves consistency, reduces friction when shipping updates, and helps engineers deliver high-quality interfaces faster.

The workshop starts with your goals for product quality and delivery speed. We work with your engineering leadership to design a plan around your codebase and coach your team through shipping reliable, maintainable UI with Phlex.

  • Leadership kickoff to align on product and delivery goals
  • Custom training plan based on your existing stack
  • Hands-on instruction and team coaching sessions
  • Follow-ups to reinforce progress and maintain momentum
  • Lifetime access to all workshop materials and recordings
Let's plan a workshop together

Frequently asked questions

Do I have to buy one course per person?

Yes. If you think about it, you're not really buying a video. What you're buying is the ability to level up and ship faster, higher-quality code. If there are 3 people on your team who are interested in the course, you'd purchase 3 courses. If 2 more people join the team, you can buy more from account management.

When you check out, select the number of courses you'd like to buy for people on your team with the "Quantity" drop-down. Crafting these videos is time-consuming and costs real money. Your support means I can make even more of these videos. 🙏

Do you do team workshops?

I sure do! Email somebody@beautifulruby.com and let's start talking about your goals and objectives so we can structure workshops, coaching sessions, and lesson plans that will move your product or organization forward.

What if I'm not satisfied with the course?

First, please share what could be improved. If you're still not satisfied, you can get a refund.

Are there discounts?

I get it—$379 is easier to spend when it comes out of a training budget or is a business expense. If you're a student, or if that's not you, reach out to somebody@beautifulruby.com and let's talk.

Can I get a receipt?

Of course! You'll need it for your expense reports or tax documentation. After you pay for the course, you should receive a receipt by email. You can also request one at any time from account management or reach out.

What does "lifetime access" mean?

You'll always be able to access this website to watch videos. If, for some reason, the website needs to be taken down, you'll be offered a downloadable format that you can store on your own device.

Who is this course for?

This course is perfect for anyone who wants to build maintainable, testable, and reusable Rails frontends using Phlex components.

  • Rails developers frustrated by tangled ERB, Haml, or Slim views
  • Frontend engineers looking to adopt component-driven UI patterns in Rails
  • Team leads and architects seeking scalable, consistent UI abstractions
  • Full-stack developers aiming to streamline collaboration between backend, UI, and design
  • Beginners eager to learn modern Rails UI development best practices

Checkout in minutes

Use Apple Pay, Amazon Pay, or your credit card to order this course and we'll email you the receipt.

Purchase video course for $379 $329