Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...
When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...
TL;DR PostgreSQL handles Rails 4+ text and string columns the same. Some libraries may still reflect on the column...
Ruby has two different ways to match the start and the end of a text: ^ (Start of line) and $ (End...
It is very common to parse dates from strings. It seems obvious to use Date.parse for this job. However this...
In the past we validate and set default values for boolean attributes in Rails and not the database itself.
CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...
Understand how nested attributes appear in the params. See how the Rails form helpers encode the names of nested...
Action Mailer Basics and Previews Chapter "Task H1: Sending Confirmation Emails" from Agile Web Development with Rails (in our...
With Ubuntu 24.04 it's not longer possible to setup FDE with BTRFS The new installer won't offer you...
There are several ways to run a single spec. I usually copy the spec file path with the line number...
Learn to store attachments in a way that is accessible by authorized users only Learn to prevent users from...
There is a practical short list for valid/invalid example email addresses - Thanks to Florian L.! The definition for valid emails...
Version 3.7.0 broke some things in complex forms. Sorry for that. Concurrent user input is hard. 3.7.1 This change fixes...
If the project team consists of at least 2 members, do a daily standup. It should not take much longer...
tl;dr Do not use the option optional on association declarations with a symbol, lambda or proc. Explanation Association declarations...
Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...
If validations failed for a record, and you want to find out if a specific validation failed, you can leverage...
Use form models to handle this problem Or soften the validation to validates_presence_of :parent
validates_acceptance_of :terms only works if terms is set to a value. The validation is skipped silently when terms...
In Ruby you can communicate between processes with sockets. This might be helpful in tests that validate parallel executions or...
This is a personal post-mortem analysis of a project that was mainly build to provide a REST API to...
We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...
The 90s are calling: they want their tables back. Unfortunately, you need them all for laying out your HTML emails...