Tutorials



One Weird Trick That Will Speed Up Your Bundle Install
So we know that more threads don’t seem to help us much, at least not with our default Rails/MRI setup, and that we’re probably going to need to have a way to get multiple CPU cores involved in order to use parallelism to speed things up. Bundler ...

Building a Component Library in Rails With Storybook — Orbit Blog
In recent years, the Rails ecosystem improved by leaps and bounds and is catching up with the evolutions that developers use and love in JavaScript frameworks.Under the code name NEW MAGIC (now known as Hotwire), the Basecamp team released Turbo a...

Rails 7 adds invert_where method to ActiveRecord | Saeloun Blog
We often come across cases in our Rails application where we want to negate our where clause conditions.Let’s say we have a system that requires users to verify both their email and phone number. We add two columns email_verified and phone_verifie...


Listing the contents of a remote ZIP archive, without downloading the entire file – Zoned Out
Why I needed to do this is a longer story, but this was a question I was looking for an answer to.Initially it led me to the following SO question:Is it possible to download just part of a ZIP archive (e.g. one file)?Not exactly the same problem b...

Rack apps mounted in Rails — how to protect access to them?
Sidekiq, Flipper, RailsEventStore — what do these Rails gems have in common? They all ship web apps with UI to enhance their usefulness in the application. Getting an overview of processed jobs, managing visibility of feature toggles, browsing eve...

Quicksort, a Ruby implementation using Test-driven development
Quicksort is a sorting algorithm designed to have a reasonable time complexity.In average, most implementations of this algorithm are capable of coming to O(n log(n)). It is implemented by many programming languages and platforms, being one of the...

How to Implement API Key Authentication in Rails Without Devise
It's gotta be at least once a week that I see somebody on /r/rails or Stack Overflow asking how to implement API key authentication using Ruby on Rails. Most of the time they ask how to do it with the ubiquitous Devise gem, or the accepted answer ...