I recently wanted to add a model for address information but also wanted to add a unique index to those...
It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...
Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...
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...
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...
RSpec's let allows you to super into "outside" definitions, in parent contexts. Example: describe '#save' do subject { described_class.new(attributes...
Sometimes we write plain SQL queries in migrations so we don't have to mock ActiveRecord classes. These two migrations...
Since Rails 6.1, if we use where.not with multiple attributes, it applies logical NAND (NOT(A) OR NOT(B)) instead...
In my case [...] the catalog is an XML that contains all kinds of possible products, categories and vendors and it...
Proxy caching is a good feature to serve your publicly visible application content faster and reduce load on your servers...
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...
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.
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...
git --fixup is very handy to amend a change to a previous commit. You can then autosquash your commits with...
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...
We had a card that described how to install multiple mysql versions using mysql-sandbox. Nowadays with the wide adoption...
The Node Version Manager allows installing multiple NodeJS versions and switching between them. By default, it does not automatically switch...