To apply transparency to an element, you can use opacity in CSS. However, sometimes you don't want to make...

For Rails models where only one of multiple attributes may be filled out at the same time, there is no...

...index: true option. Use it only inside create_table or for add_reference (= add_belongs_to) statements, and use add_index for other cases. Never use index: true but only...

Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...

makandra Curriculum

...diverge from remote code. These exercises emulate such situations. You are free to apply better naming conventions to the requested commit messages, they are only kept short here to fit...

I recently enjoyed debugging a Cucumber step that tried to be retryable using a patiently block: Then /^"([^"]*)" should( not)? be...

This is painful. Consider using Microsoft Office or switching careers. If you need to write < 20 letters consider doing it...

Rails' url_for is useful for generating routes from a Hash, but can lead to an open redirect vulnerability.

When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module. This card describes how to test that extracted behavior without...

...repeating yourself. Note that the examples below use Modularity traits to extract shared behavior. This is simply because we like to do it that way at makandra. The same techniques...

TL;DR There are three dimensions you can control when scoping routes: path helpers, URL segments, and controller/view module.

Learn to store attachments in a way that is accessible by authorized users only Learn to prevent users from...

Since I use this a lot in my daily work and there were no scripts working properly for me, I...

When requests arrive at the application servers simultaneously, weird things can happen. Sometimes, this can also happen if a user...

...all Unpoly updates work using AJAX requests, you won't get the more detailled better_errors page with the interactive REPL. Below is an event listener that automatically repeats the...

...full CSS and JavaScript. The code assumes you are using Ruby on Rails with better_errors, which is the default error view that modern Rails versions employ. If you are...

IRB 1.2 (shipped with Ruby 2.7, but works on 2.5+) brings pretty syntax highlighting and multiline cursor navigation. However, pasting...

Capybara provides execute_script and evaluate_script to execute JavaScript code in a Selenium-controlled browser. This however is not...

makandra Operations

JSON Web Tokens are often times used for authentication delegation from one system to another. They can be decoded for...

...between added? and of_kind? While added? might feel more natural to use, it behaves differently than of_kind? because it also compares options from the validation error. of_kind...

postgresql.org

TL;DR PostgreSQL handles Rails 4+ text and string columns the same. Some libraries may still reflect on the column...

github.com

The parallel-gem is quite easy to use and can speed up rendering time if you want to render the...

When setting up cronjobs, commands somtimes output something every time. If these commands don't support limiting their output to...

While it might be tempting to set it per project (other devs might benefit from it), you need to do it each time for every project "pollute" a project...

When HTTP clients make an request they can define which response formats they can process. They do it by adding...

This card explains how to generate an entity relationship diagram for your Rails application. We also show how to limit...