Skip to main content

Posts (Page 2)

How to name Active Job Classes and Queues

Strategies for name spacing Active Job queues & class names.

How to Lint FactoryBot Factories with RSpec

Invalid factories are the worst. Here is a script I normally drop into my rails projects to help spot them.

How to set "Cache-Control" headers for Rails Webpacker & Sprockets Assets

Fix that pesky "Serving static assets with an efficient cache policy" PageSpeed suggestion.

How to Speed Up Heroku CI via In Dyno Databases

My tests were feeling very slow in Heroku CI, I got a 2x speedup by changing one line of code.

How to use Yard for offline documentation

I like to work offline, this documents my current setup & how I'm using puma-dev to make it effortless.

Listening to Bootstrap Events in Stimulus Controllers

Bootstrap fires events via jQuery, which doesn't play to nicely with Stimulus. Here is how to make them play nicely.

Using ActionCable & Stimulus to remotely update partials in Rails 6

How to provide real-time updates to a user in Rails 6, without having to reload the page.

Storing a String in ActiveStorage

Rails ActiveStorage is a great way of saving files, but you can also store blobs of text.

Improving RSpec's Profiling by compiling assets

Compiling my test assets before running specs saved a few seconds.

Using Signed Global ID in Rails

Lookup objects from a string of text, way better then passing ID references around.