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

While deploying an Ruby update to an old application these days, we encountered the following misleading error: *** [err :: some-host.makandra.de] You...

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

Bundler 2 requires at least Ruby 2.3.0 and RubyGems 2.5.0. You might get the following error when you try to...

makandra dev

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

tableplus.io

To remove all tables from a database (but keep the database itself), you have two options. Option 1: Drop the...

I had this error: > gem install bundler Successfully installed bundler-2.0.1 1 gem installed > bundle install Traceback (most recent call...

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

makandra dev

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

makandra Curriculum

When your code does not behave as expected, you can use a debugger statement ("breakpoint") at any point in your...

stackoverflow.com

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