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

When you build a JSON API you need to come up with a style to represent attributes, pagination, errors or...

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

Recently we detected a memory leak in one of our applications. Hunting it down, we found that the memory leak...

developer.mozilla.org

The inset CSS property is a shorthand that corresponds to the top, right, bottom, and/or left properties. It has the...

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

When you are working with SVG files and ImageMagick you can get different results on different machines depending on which...

The gemspec for gems allows to add metadata to your gem, some of which have a special meaning and are...

github.com

ruby-warning adds custom processing for warnings, including the ability to ignore specific warning messages, ignore warnings in specific files/directories...

This card explains how to generate an entity relationship diagram for your Rails application. We also show how to limit...

Sometimes we write plain SQL queries in migrations so we don't have to mock ActiveRecord classes. These two migrations...

You want to deploy new features but the latest commits are not ready for production? Then use git merge master...

github.com

When Capybara locates elements in the DOM, by default it allows only accessing visible elements -- when you are using a...

Sometimes you need to access a dev server running on localhost from another machine that is not part of the...

RSpec Rails can automatically mix in different behaviors to your tests based on their type tag, for example enabling you...

Since Rails 6.1, if we use where.not with multiple attributes, it applies logical NAND (NOT(A) OR NOT(B)) instead...

You can use RSpec::Matchers.define_negated_matcher to define a negated version of an existing matcher. This is particularly useful...

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

From Exploring ES6: Module imports are hoisted (internally moved to the beginning of the current scope). Therefore, it doesn’t...

Jasmine is a great way to unit test your JavaScript components without writing an expensive end-to-end test for...

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...

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

You want to use fields in your applications. However, your desktop users may encounter some weird quirks: Aside from allowing...

Event delegation is a pattern where a container element has a single event listener that handles events for all descendants...