Blog
How to minify and add vendor prefixes in Rails 7
If you fire up a new Rails 7 project, youâll probably be missing a couple of tools you should have: minification and vendor prefixing. Minification takes our JavaScript and CSS assets and squishes everything down by removing whitespace to make file sizes smaller. Adding vendor prefixes helps normalize the way our CSS...
Fixing page jump in Rails websites using Turbo
This was a very annoying problem that had a straightforward fix but was hard to track down.
You have a Rails website using Hotwire/Turbo that is, after clicking a link, skipping to the top before navigating to the requested page. The steps needed to replicate are:
- Scroll to the bottom of the current page
- Click a lin...
Regex match for spaces outside of HTML tags
:::{info} This turns out to be quite a tricky problem to solve. The solution below is meh. I have since stumbled across a fantastic gem called Truncato that handles these situations beautifully. :::
Letâs say you are truncating a blog post to produce an excerpt for multiple posts in an index view. In Ruby on Rails, ...
How to prepare Rails assets before running tests
Iâm currently building a Rails 7 app that was started with rails new myapp --css=bootstrap
. This means Rails set up my app to use esbuild to compile all my CSS and JavaScript assets. This new --css
flag provided by Rails is a fantastic improvement over previous implementations like Webpacker. Now we can just run bin/...
How to exclude ID lookup by integer when using FriendlyId
Hello there! Are you at the point in your Ruby on Rails project where youâd like integer-based slugs like /users/2
to be friendlier and look like /users/matt
instead? How about /posts/how-to-make-great-tacos
instead of /posts/31
? There are many reasons youâd want to do something like this, and thereâs a great gem...
Pinched nerve
My creative drive is writing checks my body canât cash. It has come to my attention that, as an Elder Millenial, I canât combine new office equipment with increased hours working and expect to walk away unscathed. Multiplying the directional change in my gaze by the number of hours at my desk has resulted in a pinc...
Using Clearance with Rails 7
For some time now, the Ruby on Rails community has anointed Devise as its preferred authentication solution. Iâve repeatedly used Devise, and itâs great. Not all of us have the time or expertise to roll our own auth, so itâs fantastic a solution exists that is widely adopted. It was only natural that Iâd reach ...
My new system
Iâve been starting my weekdays at 4:00 am for the last seven weeks. Itâs dark, and the sound of silence is all around. I made the change to my morning routine âcold turkeyâ and havenât missed a day. I am typically in bed before 9:00 pm and asleep shortly after. Iâm shooting for seven hours of sleep a night,...
Apple Studio Displays
Thanks to ordering the VESA mount option, Iâm too late to the party to do a spec review, but I want to address the mood in the room. The internet sure went on a hot take rampage with these displays, didnât they? There was a lot of disappointment and exasperation flying around. Hereâs why I think a lot of the frus...
I cancelled my Hey email accounts
Yesterday I canceled two @heyhey email accounts. Itâs really hard to figure out what the two fellas at the top were thinking by implementing their new company policy on political/social discussions. Itâs especially bizarre given the outspoken nature of both the founders.
Unfortunately, itâs becoming apparent tod...
Blog Categories
About These Posts

My blog primarily contains writings about my work on computers, but I occasionally mix in fun life stuff. I am, at best, a mediocre writer, but I like doing my part to give back to the community. Feel free to contact me if you have specific something to chat about. See you around!