Christopher Bennell

I build web stuff. Full Stack/Platform Engineering/Architecture. Senior Software Engineer.

Posts tagged “rails”

6 posts

• 2 min read

Default, Dynamic Slot Content in Rails ViewComponents

Ever wished your ViewComponent slots could have dynamic defaults? In this post, I show how I built an Alert component that automatically picks the right icon for its type, but can easily swap in a spinner or any custom icon with a single line of code.
• 3 min read

Filtering by Association Count in Complex Models in Rails

Filtering complex associations in Rails can get tricky: built-in methods like where.associated don’t always provide efficient results. Here’s how I used a SQL subquery inside Rails scopes to make a slow page fast again.
• 3 min read

Rails "Disable-able" Button ViewComponent / Phlex Component

Need a button that enables or disables itself in response to events? I explain how to build a reusable DisableableButton in Rails using ViewComponent (or Phlex) plus a tiny Stimulus controller—perfect for forms where you only want to allow submission once inputs are valid.
• 8 min read

Building an LTI DeepLinking Response in Rails

DeepLinking lets your LTI tool send content back to the LMS—like inserting rich HTML into Canvas’s editor. This guide walks through persisting launch data, building a response form, rendering Rails views into JWTs, and even making the whole flow dynamic with Turbo.
• 6 min read

Handling LTI Launches in Rails

Learn how to set up your Rails application as an LTI Tool Provider, to handle LTI 1.3 launches from an LMS, including the OCID workflow, user authentication and what to do with the information you get from the LMS.
• 2 min read

On "Layered Design for Ruby on Rails Applications"

From DDD-inspired architecture to patterns like query objects and service layers, Dementyev’s book explores how Rails apps can evolve stronger abstractions over time. Ideal for developers who want to move beyond basics and design with clarity and intent.