Imagine these models and associations: class Deck < ApplicationRecord has_many :cards end class Card < ApplicationRecord belongs_to :deck, optional: true...
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...
Recent IRB versions include a multi-line autocomplete which may be helpful to novice users but can be distracting.
It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...
While verifying doubles in RSpec is a good default, it is limited in the amount of methods it actually is...
There is a way to use multiple databases in Rails. You may have asked yourself how you're able to...
tl;dr You can use attribute? as shorthanded version of attribute.present?, except for numeric attributes and associations. Technical Details
Due to the way we setup Jasmine tests in our projects, you may run into various errors when Jasmine boots...
This card explains how to generate an entity relationship diagram for your Rails application. We also show how to limit...
This are the steps I needed to do to add esbuild to an application that used the vanilla rails asset...
We use foreman to start all necessary processes for an application, which are declared in a Procfile. This is very...
Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...
Attaching files to a field that is handled by Carrierwave uploaders (or maybe any other attachment solution for Rails) in...
Jasmine is a great tool to unit test your JavaScript components without writing an expensive end-to-end test for...
Learn to create test data effectively using factories. Decouple tests by having each test start with an empty database...
JavaScript code can access and manipulate the browser's DOM tree. Using JavaScript we can add interactive behavior to our...
RSpec Rails can automatically mix in different behaviors to your tests based on their type tag, for example enabling you...
Since Rails 6.1, if we use where.not with multiple attributes, it applies logical NAND (NOT(A) OR NOT(B)) instead...
TL;DR When using Cache-Control on a Rails application, make sure the Vary: Accept header is set.
Rack::SteadyETag is a Rack middleware that generates the same default ETag for responses that only differ in CSRF tokens...
Field error steps Spreewald's The...
...field should have an error and The...
...field should have the error...
...steps now...
From Exploring ES6: Module imports are hoisted (internally moved to the beginning of the current scope). Therefore, it doesn’t...
Jasmine is a great way to unit test your JavaScript components without writing an expensive end-to-end test for...