Haml 6 was a major rewrite with performance in mind. To achieve a performance improvement of 1.7x, some design...

Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...

makandra dev

This is a checklist I use to work on issues. For this purpose I extracted several cards related to the...

In the past we validate and set default values for boolean attributes in Rails and not the database itself.

blog.logrocket.com

Variable fonts are popular for two reasons: they expand design possibilities and improve website performance. While the former statement is...

tl;dr Since Rails 7+ you can use ComparisonValidator for validations like greater_than, less_than, etc. on dates, numerics...

You can use ETags to allow clients to use cached responses, if your application would send the same contents as...

wpostats.com

Case studies and experiments demonstrating the impact of web performance optimization (WPO) on user experience and business metrics.

To allow HTTP 304 responses, Rails offers the fresh_when method for controllers. The most common way is to pass...

When working with feature branches, stale branches pile up over time. It's best to remove them right after merge...

When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:

It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...

While verifying doubles in RSpec is a good default, it is limited in the amount of methods it actually is...

You can use Unpoly's up.on with a named listener function and immediately unbind this event listener with { once: true...

When you need information about a gem (like version(s) or install path(s)), you can use the gem binary...

tl;dr: Use the URLSearchParams API to make your live easier if you want to get or manipulate query parameters...

Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots...

RSpec's let allows you to super into "outside" definitions, in parent contexts. Example: describe '#save' do subject { described_class.new(attributes...

makandra dev

To ensure a consistent code style for JavaScript code, we use ESLint. The workflow is similar to integrating rubocop...

Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...

When using where.not with a Hash of multiple attributes, Rails applies logical NAND (NOT (A AND B)). This contrasts with...

TL;DR When using Cache-Control on a Rails application, make sure the Vary: Accept header is set.

Within development and test environments, Rails is usually configured to show a detailed debug page instead of 404s. However, there...

This RailsCast demonstrated a very convenient method to activate VCR for a spec by simply tagging it with :vcr.