Do you ever feel like there should be an easier way to snap pieces together to build UIs in Rails? Have you felt lost in the sea of ERB templates, partials, and helpers? Have you tried to tame it, but got burned with bad or opaque abstractions?
Building Rails front-ends should be a joy, not a chore.
Phlex 🤝 ERB
ERB is awesome. It’s flexible, intuitive, and has served Rails well for decades. But as your app grows, do your views stay easy to reason about? Are your templates truly simple or just familiar?
Phlex and Superview don’t replace ERB. They work alongside it, letting you gradually introduce more structure without breaking your flow.
Don’t get burned 🔥 by bad abstractions 🙅‍♀️
Rails devs have been promised “better ways” before—only to end up with DSL hell, overengineered APIs, and a mess worse than what they started with. This course is different.. No magic, no bloated layers of indirection—just clean, predictable, maintainable Rails views that grow with your team.
For Those Who Already “Get” Components
You already know components make sense. You’ve seen them work in React, Vue, and elsewhere. Maybe you’ve even dabbled with ViewComponent. But how do you do it properly in Rails?
This course will show you how to apply component-based UI patterns to Rails the Rails way—without sacrificing the elegance of the framework.
For Teams Incrementally Moving Away from ERB
Your Rails app is built on ERB, and rewriting everything at once isn’t an option. The good news? You don’t have to.
This course will show you how to introduce Phlex and Superview incrementally, allowing you to modernize your app without a painful migration.
Module 1: Introduction to Component-Based Rendering in Rails
Lesson 1: Why Rails Views Need a Better Approach
- The evolution of Rails views: ERB, HAML, Slim, and beyond
- The pain points of traditional Rails views
- Why component-based rendering solves these issues
- How Phlex and Superview fit into the Rails ecosystem
Lesson 2: Setting Up Your Environment
- Installing Phlex and Superview
- Configuring Rails to support component rendering
- Basic syntax and conventions of Phlex
Module 2: Deep Dive into Phlex
Lesson 3: Building Your First Phlex Component
- Rendering HTML using Phlex
- How Phlex differs from traditional ERB templates
- Using instance variables, loops, and conditionals in Phlex
Lesson 4: Composing Complex Views with Phlex
- Structuring large Phlex components
- Reusable layouts and partials in Phlex
- Managing dependencies and data flow
Module 3: Superview – Automating Component Rendering
Lesson 5: Hacking Rails Controller Actions for Component Rendering
- Understanding implicit rendering in Rails
- The
method_for_action
method and how to override it - How Superview automates component rendering
Lesson 6: Rendering Phlex and ViewComponent Classes with Superview
- How Superview dynamically resolves components
- Using
renders_in
andattr_writer
to pass data - Managing multiple formats (HTML, JSON, etc.)
Module 4: Advanced Rails Controller Techniques
Lesson 7: Building Bulk Actions with method_for_action
- How
method_for_action
lets you dynamically route actions - Using form submit buttons to trigger different bulk actions
- Extracting logic into a concern for cleaner controllers
Lesson 8: Extending Superview for Custom Use Cases
- Modifying Superview for special rendering needs
- Conditional rendering of different components
- Debugging and testing Superview-based controllers
Module 5: Best Practices for Scaling Component-Based Rails Apps
Lesson 9: Organizing Your Component Library
- Where to store your Phlex components
- Naming conventions for maintainability
- Using Rails autoloading with
config.autoload_paths
Lesson 10: Performance Considerations for Component-Based Rendering
- Reducing database queries in Phlex components
- Using memoization and caching to speed up rendering
- Handling large datasets efficiently
Module 6: Putting It All Together
Lesson 11: Refactoring a Traditional Rails App with Phlex and Superview
- Migrating an existing Rails app to use component-based rendering
- Replacing ERB templates with Phlex components
- Removing unnecessary controller boilerplate with Superview
Lesson 12: Final Project – Building a Scalable Rails App with Phlex
- Hands-on project: Implementing a Rails app with Superview and Phlex
- Structuring controllers and views for long-term maintainability
- Deploying and testing your component-based Rails app
Course Wrap-Up
- Recap of key lessons learned
- Next steps for further learning
- Resources and community for continued growth
Who This Course is For
âś… Rails developers looking to simplify and scale frontend rendering âś… Engineering teams working on large Rails applications âś… Developers with training budgets who want to level up their Rails view layer âś… ERB lovers who want to make it more manageable âś… Skeptics of magic-heavy abstractions âś… Teams with legacy Rails apps who want a smooth transition to components
Pricing and Access
- Cost: $299
- Format: Video lessons + hands-on coding exercises
- Includes: Code samples, projects, and lifetime access