Rails partials have a lot of "hidden" features and this card describes some non-obvious usages of Rails Partials.
In the past we validate and set default values for boolean attributes in Rails and not the database itself.
HTTP header values must only contain low-ASCII (7-bit) characters for safe transport. From RFC 7230: Historically, HTTP has...
Not all email clients support external images in all situations, e.g. an image within a link. In some cases, a...
The linked article found a simple way to rewrite legacy git aliases to make them work with differently named default...
To read the current breakpoint tier in JavaScript, employ this CSS: :root { --current-breakpoint-tier: xs; @media (min-width: $screen...
In a Jasmine spec you want to spy on a function that is imported by the code under test. This...
Usually, Unpoly compiler destructors are returned from the compiler function. However, when using async compiler functions, you can not register...
The cards editor has a feature "Cite other card" to create links to other cards in the same deck as...
Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...
Jasmine specs that work with DOM elements often leave elements in the DOM after they're done. This will leak...
tl;dr In Chrome DevTools in the Elements tab or in Firefox in the Inspector tab you can right click...
Here are a few common patterns that will probably lead to flaky specs. If you notice them in your specs...
tl;dr git checkout is the swiss army of git commands. If you prefer a semantically more meaningful command for...
You have uncommited changes (you can always check by using git status), which you want to discard.
You can use the code below to check whether the browser can make connections to the current site: await isOnline...
It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...
Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...
tl;dr With ES2021 you now can use str.replaceAll(), Promise.any(), logical assignment operators, numeric separators and WeakRef on all major...
In Chrome DevTools you can use getEventListeners(object) to get a list of registered event listeners on the specified object...
tl;dr: Use the URLSearchParams API to make your live easier if you want to get or manipulate query parameters...
Sometimes you will need an input field which wraps content and grows in height as soon as content gets longer...
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...