Issue: You have an app using jsbundling-rails and esbuild. After deploy, the assets built by esbuild are missing in...

Ruby includes many standard gems that are bundled into the Ruby installation. Here is an example for the gem strscan...

tl;dr Since Rails 6.1+ you can use .compact_blank or .compact_blank! to remove blank values from collections (e.g...

blog.saeloun.com

Imagine these models and associations: class Deck < ApplicationRecord has_many :cards end class Card < ApplicationRecord belongs_to :deck, optional: true...

When redirecting you should take care to use the right HTTP status code. From controllers When redirecting from a controller...

Recent IRB versions include a multi-line autocomplete which may be helpful to novice users but can be distracting.

makandra dev

You'll need openssl-3 or newer for servers running 22.04 Ruby version 3.1 uses by default the gem openssl...

tl;dr You can use attribute? as shorthanded version of attribute.present?, except for numeric attributes and associations. Technical Details

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

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

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

Redis.current will be removed without replacement in redis-rb 5.0. Version 4.6.0 adds deprecation warnings for Redis.current and Redis.current=: `Redis.current...

This are the steps I needed to do to add esbuild to an application that used the vanilla rails asset...

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

Attaching files to a field that is handled by Carrierwave uploaders (or maybe any other attachment solution for Rails) in...

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

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.

The Interactive Advertising Bureau (IAB) is a European marketing association which has introduced a standard how advertising can be served...

makandra dev
stackoverflow.com

Modern versions of Capybara include a finder method #ancestor which allows you to find a parental element using CSS or...

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...

makandra dev

If you want Sidekiq to be able to talk to Redis on staging and production servers, you need to add...

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