Greg Molnar has written a neat article about creating a single-file Rails app. This is not meant for production...
When working with feature branches, stale branches pile up over time. It's best to remove them right after merge...
When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:
The linked content includes a few design patterns implemented with Ruby on Rails. What is the card indented to achieve...
These are the results of the "personal tech stack survey". I've included only the most popular mentions, maybe it...
SELECT pg_size_pretty(pg_database_size('some-database')); Example SELECT pg_size_pretty(pg_database_size('cards_p')); ----------------
tl;dr Since Rails 6.1+ you can use .compact_blank or .compact_blank! to remove blank values from collections (e.g...
When paginating records, we usually need to know the number of total records in order to render pagination links. Popular...
You can use the code below to check whether the browser can make connections to the current site: await isOnline...
When changing code in mailers, updating the corresponding mailer preview can be forgotten very easily. Mailer previews can be tested...
When redirecting you should take care to use the right HTTP status code. From controllers When redirecting from a controller...
It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...
I recently had the problem that embedded code boxes crashed my layout. It turned out that pres break out of...
Code quality can be measured in four levels: (Working code) Reliable code (minimum) Readable code (ok for short-lived code...
There is a way to use multiple databases in Rails. You may have asked yourself how you're able to...
You can use Unpoly's up.on with a named listener function and immediately unbind this event listener with { once: true...
ruby-warning adds custom processing for warnings, including the ability to ignore specific warning messages, ignore warnings in specific files/directories...
Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots...
Redis.current will be removed without replacement in redis-rb 5.0. Version 4.6.0 adds deprecation warnings for Redis.current and Redis.current=: `Redis.current...
While we are used to run our JavaScript tests on a test page within our Browser, it's also possible...
I recently was in a weird situation where my (Jest/CLI) tests were referencing a function that was no longer part...
RSpec's let allows you to super into "outside" definitions, in parent contexts. Example: describe '#save' do subject { described_class.new(attributes...
To ensure a consistent code style for JavaScript code, we use ESLint. The workflow is similar to integrating rubocop...
Sometimes we write plain SQL queries in migrations so we don't have to mock ActiveRecord classes. These two migrations...