To avoid multiple versions of a package, you can manually maintain a resolutions section in your package.json. We recommend you...
When doing some meta-programming magic and you want to do something for all attributes of a class, you may...
This is a short overview of things that are required to upgrade a project from the Asset Pipeline to Webpacker...
In Rails, we usually have a mailer setup like this: class MyMailer < ActionMailer::Base def newsletter mail to: 'receiver@host.tld',
Many mail clients do not support external style sheets. Some even require all styling inline, which means you'll have...
Rails' ActiveSupport::TimeWithZone objects have both a timezone code and offset, e.g. Thu, 28 Mar 2019 16:00:00 CET...
Sometimes you might need to do some task in GitLab which would be tedious if you'd have to do...
You can use .ids on an ActiveRecord 4+ scope to pluck all the ids of the relation User.where("users.name LIKE...
From at least Rails 4, the ActionView tag helper turns Array values of HTML options into a single space-separated...
Webpacker is Rails' way of integrating Webpack, and version 4 has been released just a few days ago, allowing us...
Rails' params hash contains any request parameters (URL parameters or request payload) as well as routing parameters like :controller, :action...
This is a presentation from 2019-01-21. Summary We want to move away from jQuery in future projects
When restoring a PostgreSQL dump using pg_restore, you usually add the --clean flag to remove any existing data from...
To remove all tables from a database (but keep the database itself), you have two options. Option 1: Drop the...
When building an application that sends e-mails to users, you want to avoid those e-mails from being classified...
If your app does not need to support IE11, you can use most ES6 features without a build step. Just...
Suggested Workflow Set the ruby version in .ruby-version to 2.3.5, then perform these steps one by one, fixing errors...
Remember How to skip Sprockets asset compile during Capistrano deployment and Automatically skipping asset compilation when assets have not changed...
Rails ships with two separate build pipelines: Sprockets ("asset pipeline") and Webpacker. Webpacker has many more moving parts, but allows...
When your code does not behave as expected, you can use a debugger statement ("breakpoint") at any point in your...
To reload a single-item association in Rails 5+, call #reload_ : post.reload_author In older Railses you can say
When upgrading Rails versions -- especially major versions -- you will run into a lot of unique issues, depending on the exact...
The Ace editor is a great enhancement when you want users to supply some kind of code (HTML, JavaScript, Ruby...
When projects run for many years, they require special regular maintenance to stay fresh. This kind of maintenance is usually...