In this example we assume that not only the storage gem changes but also the file structure on disc.

makandra dev

Cross-Site Request Forgery (CSRF) is an attack pattern for websites. A CSRF attack is usually relevant in a...

A JavaScript error in an E2E test with Selenium will not cause your test to fail. This may cause you...

island94.org

Rails 5.2 soft-deprecated the storage of secrets in secrets.yml in favor of a new thing, credentials.yml.enc. Rails 7.1 deprecated...

Geordi provides a pretty neat way to generate beautiful commit messages according to your stories in Linear: geordi commit

Geordi's cucumber command has a --rerun option that reruns failing tests the given number of times. Usage: geordi cucumber...

developer.mozilla.org

...HTML's accepts a single file. You can allow multiple files via . But sometimes, selecting multiple files is not enough...

web.archive.org

Restricting access to cookies is essential for security in many web apps. For example, the session ID, the secret token...

Most forms have a single submit button that will save the record when pressed. Sometimes a form needs additional submit...

Migrating data from a legacy into a new system can be a surprisingly large undertaking. We have done this a...

At makandra, we've built a few gems over the years. Some of these are quite popular: spreewald (> 1M downloads...

When you receive a ZIP file from a Windows user, umlauts and other non-latin1 characters in filenames may look...

Haml lets you prefix a group of attributes by wrapping them in a hash. This is only possible with the...

As a web developer, you know Google Analytics (GA). Probably you've dropped the GA snippet into more than one...

Why secure-only cookies used to be necessary Cookies have an optional secure flag. It tells the browser to not...

stackoverflow.com

Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...

Whenever is a Ruby gem that provides a nicer syntax for writing and deploying cron jobs. Leading zeros are important...

The method cookies is defined in the ActionController and should never be overwritten. Bad example class StaticPagesController < ApplicationController

When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...

Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...

makandracards.com

In medium-sized to large Rails applications, asset compilation can take several minutes. In order to speed up deployment, asset...

guides.rubyonrails.org

TL;DR I18n keys ending with _html are automatically marked as HTML-safe when translating with t('.your_key_html...

When your application is running on a multi-server setup, application logs are stored per server (unless you choose a...

When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...