Tutorials
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 ...
Create an infinite scrolling blog roll in Rails with Hotwire
In this tutorial, I'll show you how to add an infinitely scrolling blog roll using Rails and Hotwire. Note that this is different than Chris Oliver's awesome infinite scroll tutorial, in that we're loading a new post once a user scrolls to the bot...
How to Build a Twitter Clone with Rails and Hotwire · Rob Race
Hotwire is fresh out of the Basecamp Github and has set the Rails community ablaze. This quick write up is an update from How to Build a Twitter Clone with rails, ActionCable, and React to show a comparison between the two approaches.Now, this doe...