It is very common to parse dates from strings. It seems obvious to use Date.parse for this job. However this...

It is possible to access Rails config (for example secrets) from within your webpack bundles, thanks to rails-erb-loader...

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

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

If you use transactional_fixtures or the database_cleaner gem with strategy :transaction, after_commit callbacks will not be fired...

If validations failed for a record, and you want to find out if a specific validation failed, you can leverage...

Let's say you have a gem which has the following module: module SuperClient def self.foo 'Foo' end

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

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

Background information about session storage in Rails Rails has a default mechanism to store the session in the CookieStore. This...

Rails defines a #truncate helper as well as a method String#truncate. = truncate("my string", length: 5) = "my string".truncate...

makandra dev
litmus.com

The 90s are calling: they want their tables back. Unfortunately, you need them all for laying out your HTML emails...

stackoverflow.com

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

makandra dev

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

In an environment: config.logger = Logger.new('/dev/null')

Just like Ruby Gems tag their version releases to the corresponding Git commit, it can be helpful to track production...

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 Append your locale keys with _html to have them marked as html_safe and translate them with = t...

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

If your rails application is unable to send mails, it might be useful to debug your settings using the rails...

For outputting a given String in HTML, you mostly want to replace line breaks with or tags.

wiki.postgresql.org

When you have a large PG database, you may want to find out which tables are consuming the most disk...

Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs...