There is a way to use multiple databases in Rails. You may have asked yourself how you're able to...

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

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

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

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

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

In SQL, NULL represents an "unknown" value. Because of this, it does not behave like a standard piece of data...

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

css-tricks.com

An element with display: grid can define its grid-template-columns based on (preferred) child width using the repeat function...

Use option:checked to find the currently selected option: select.querySelector('option:checked') Yes, :checked, not :selected. This is the same...

dev.to

In my case [...] the catalog is an XML that contains all kinds of possible products, categories and vendors and it...

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

makandra dev

Field error steps Spreewald's The...

...field should have an error and The...

...field should have the error...

...steps now...

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

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

web.archive.org

Rails 6.1 has a "strict loading" mode that forces the developer to preload any association they plan to use. Associations...

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

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

Sometimes a link or input field has no visible label. E.g. a text field with a magnifying glass icon 🔎 and...

Most browsers have built-in drag and drop support for different page elements like text and images. While this may...

We are using Spring in our tests for sequential test execution but not for parallel test execution. And Rails requires...

It is generally discouraged to load your JavaScript by a tag in the : The reason is that a tag will pause the DOM parser until the script has loaded and executed. This will delay the browser's first contentful paint. A much better default is to load your scripts with a tag: A deferred script has many...

The attached compiler() function below applies JavaScript behavior to matching HTML elements as they enter the DOM. This works like...