Zeitwerk is the new code loader engine used in Rails 6. It’s meant to be the new default for all Rails 6+ projects replacing the old classic engine.

If we judge by its features, Zeitwerk mode seems to behave pretty much the same as the previous classic mode. The basics are very similar: models, controllers, helpers and so forth will continue to be autoloaded, reloaded and eager loaded as they have always been.

However, the main difference resides in the implementation. Zeitwerk uses a better strategy for loading things, which solves all of the known gotchas that classic mode carries.

The purpose of this post is to explain how someone would install Stimulus JS in an existing Rails application and show some examples/recommendations on how to organize code within it.

This article is not to about explaining the Stimulus JS framework. If you are beginning with Stimulus, I’d recommend checking out their getting started guide, which is super lightweight and very easy to read.

Integrating Stimulus JS with a Rails application

Using Stimulus inside a Rails app should be fairly easy. Depending on your application stack, the installation can be a little different. …

As announced in Rails 5.2.0 release candidate, Rails 5.2 will go out with a brand new credentials API that will eventually replace the current config/secrets.yml and config/secrets.yml.enc.

The intention behind this change is mainly to remove some of the confusion introduced by the combinations of config/secrets.yml, config/secrets.yml.enc and SECRET_BASE_KEY used in earlier versions of Rails, and attempt to unify everything using a more straightforward approach.

From now on, Rails 5.2 will only intend to use these two files instead:

  • config/credentials.yml.enc
  • config/master.key

Using new Rails credentials

When you upgrade Rails to v5.2, the file where you are going to store all your private credentials is…

Marcelo Casiraghi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store