Confirmation Dialog with BrutRB, Web Components, and no JS

August 18, 2025

I created a short (8 minute) screencast on adding a confirmation dialog to form submissions using BrutRB’s bundled Web Components. You don’t have to write any JavaScript, and you can completely control the look and feel with CSS.

There’s also a tutorial that does the same thing or, if you are super pressed for time:

<form>
  <brut-confirm-submit message="Are you sure?">
    <button>Save</button>
  </brut-confirm-submit>
</form>

<brut-confirmation-dialog>
  <dialog>
    <h1></h1>
    <button value="ok"></button>
    <button value="cancel">Nevermind</button>
  </dialog>
</brut-confirmation-dialog>

Progressive enhancement, and no magic attributes on existing elements.

Please Create Debuggable Systems

August 06, 2025

When a system isn’t working, it’s far easier to debug the problem when that system produces good error messages as well as useful diagnostics. Silent failures are sadly the norm, because they are just easier to implement. Systems based on conventions or automatic configuration exacerbate this problem, as they tend to just do nothing and produce no error message. Let’s see how to fix this.

Build a blog in 15ish Minutes with BrutRB

July 23, 2025

This is a whirlwind tour of the basics of Brut, where I build a blog from scratch in a bit over 15 minutes. The app is fully tested and even has basic observability as a bonus. The only software you need to install is Docker.

Brut: A New Web Framework for Ruby

July 08, 2025

A brown rectangle with a large capital 'B'. Underneathe is 'brut'

Brut aims to be a simple, yet fully-featured web framework for Ruby. It's different than other Ruby web frameworks. Brut has no controllers, verbs, or resources. You build pages, forms, and single-action handlers. You write HTML, which is generated on the server. You can write all the JavaScript and CSS you want.

One Week With Desktop Linux After a 20 Year Absence

March 21, 2025

I bought a Framework laptop a couple weeks ago, set it up with stock Ubuntu, and used it for my primary computer for a week. It’s the first time I’ve used Linux in earnest in 20 years. It’s amazing how much has changed and how much hasn’t.

HTML Web Components Re-Use Logic, Which is What You Want

September 30, 2024

Custom elements that wrap HTML (AKA “HTML Web Components”) can be extremely useful for re-using logic without requiring the user of the custom element to adopt any particular UI or styling. And this is usually the sort of re-use you actually want.

Let me demonstrate by creating a way to sort and filter any HTML table. Sorry, this is a bit long.

Achieve Static Typing Benefits in Ruby with Keywords Args and Class Constants

September 25, 2024

Noel Rappin wrote an article on static typing in Ruby that does a great job outlining the various techniques to achieve the benefits often ascribed to static typing. I have two more techniques that address the 80% case of typing problems in Ruby: keyword arguments and class constants.

In my experience, most typing issues in Ruby and Rails apps are the result of overuse of hashes as data structures, coupled with the use of symbols to refer to classes instead of using the class itself. Both of these patterns result in indirection between intention and behavior. When you get it wrong—use the wrong hash key, call the wrong dynamically-created method—you get errors that don’t make sense.