When deleting a record in your Rails app, Carrierwave automatically takes care of removing all associated files. However, the file...
If your Webpack build is slow, you can use the Speed Measure Plugin for Webpack to figure out where time...
Webpack builds can take a long time, so we only want to compile when needed. This card shows what will...
Installing gems on a server that has no access to the internet (especially rubygems.org) requires to bundle the gems into...
When you need the DOM node of a tag (e.g. to read extra attributes, or to modify the DOM near it), you can usually reference it via document.currentScript. However, document.currentScript is unsupported in ancient browsers, like Internet Explorer 11 or wkhtmltopdf's Webkit engine. If you are not running async scripts, you can easily polyfill it: document.scripts[document.scripts.length - 1] It works because document.scripts grows with each tag that was evaluated. That is also the reason why this solution will not work reliably for async code. Demo: https://codepen.io/foobear/pen/poRLxQm
To attach files to your records, you will need a new database column representing the filename of the file...
https://tableconvert.com/ is an online tool to convert tables between different formats (e.g. json, markdown, csv).
In Ruby (almost) everything is an Object. While this enables a lot of powerful features, this concept might be confusing...
The ActionDispatch module of Rails gives you the helper method flash to access the flash messages in a response.
json is part of the standard library of Ruby and deals with JSON, obviously. As you know, JSON is the...
5.4.0 2021-02-01 Compatible changes Add geordi branch command that checks out a feature branch based on a story...
By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky...
CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...
A rough guide how to implement a REST API. The discussion here includes some interesting points as well: Timestamps: ISO8601...
The linked article provides a good overview of the various concurrency primitives in Ruby, and what's changing in Ruby...
When you repeat a subpattern with a *, + or {...} operator, you may choose between greedy, lazy and possessive modes. Switching modes...
Recently I made an upgrade from Bootstrap 3 to Bootstrap 4 in a bigger project. Here are some tips how...
Consider the following models and form models: class Parent < ApplicationRecord has_many :children, class_name: 'Child', foreign_key: 'parent_id...
When running an older version of docker-compose you might see the following error: ERROR: Version in "./docker-compose.yml" is unsupported...
Rails 6 includes a WYSIWYG editor, Action Text. It works out of the box quite well, but chances are that...
PostgreSQL has partial indexes. With a partial index you tell Postgres to only index rows matching a given query.
There are several tools for DNS debugging which offer you more or less information. Most of the time the more...
Rails supports alert and notice as default flash types. This allows you to use these keys as options in e.g...
I just finished migrating a project from the Asset Pipeline to Webpacker, this is what my diff to master looks...