Always disable autocomplete for date pickers

Browser autofill can cover date picker popups and make them unusable. Disabling autocomplete on the trigger input keeps the calendar visible while preserving fallback behavior.

ActiveRecord: Specifying conditions on an associated table

ActiveRecord queries can filter on columns from an associated table without raw SQL, using subqueries, ID plucking, traverse_association, or joins.

How to write modular code

Reduce spaghetti code by splitting behavior into focused functions, service classes, form models, and value objects, while avoiding long parameter lists and excessive DRY.

Checklist: Using Carrierwave in a Rails project

Checklist for CarrierWave edge cases beyond the default Rails setup: secure URLs, image resizing, metadata handling, file validation, and efficient processing.

Always convert and strip user-provided images to sRGB

User-uploaded images can lose correct colors if metadata is stripped before color conversion. Converting to sRGB and reattaching the profile keeps browser rendering consistent.

Defining new elements for your HTML document

Custom elements let you create semantic HTML components that browsers render normally and activate directly with customElements.define(), avoiding framework-specific compilation.

How to update the bundler version in a Gemfile.lock

Bundler versions in Gemfile.lock can lag behind the installed release and break compatibility with older Ruby or Rails setups. Updating bundler and regenerating the lockfile keeps BUNDLED WITH aligned.

Capybara: Execute asynchronous JavaScript

evaluate_async_script runs asynchronous JavaScript in Capybara and waits for completion, avoiding Selenium timeouts and allowing Ruby to receive results or error details.

Rails: Do not load frameworks you don't need

Loading every Rails framework increases startup time and memory use; disabling unused railties and gems keeps apps lighter and avoids unnecessary configuration.

Controlling how your website appears on social media feeds

Social network previews often pick the wrong title, image and description unless OpenGraph meta tags provide them; Facebook caches previews and may need manual refresh.

Ruby: How to use global variables for a conditional debugger

Global variables can temporarily gate a Ruby debugger, avoiding repeated stops in callbacks and specs when only one execution path matters.

Unpoly: Showing the better_errors page when Rails raises an error

AJAX errors in Unpoly can hide the full better_errors page in Rails development. A fallback full-page reload restores the interactive error view and CSS.

RubyMine: Efficiently filtering results in the "Finder" overlay

RubyMine Finder searches can return huge result sets; file masks, directory limits, regex, and other filters narrow matches and speed up locating the right code.

Jasmine: using async/await to write asynchronous specs

Readable Jasmine specs can use async/await for promises, async setup, event waiting, and controllable async spies instead of done callbacks.

Documenting your project's Node.js version in .nvmrc

Node.js compatibility depends on the exact runtime version, and projects can pin a supported release in .nvmrc so teams use the same setup.

Events triggered by jQuery cannot be observed by native event listeners

jQuery trigger() emits events that native addEventListener() handlers cannot observe, which breaks mixed jQuery and non-jQuery code. Native dispatchEvent() works for both worlds.

Webpack: How to split your bundles

Large JavaScript libraries can bloat the main bundle; import() lets webpack load them asynchronously and keep rarely used code out of the initial payload.

Capybara: Testing file downloads

File downloads are awkward to verify with Selenium because browsers may prompt, auto-save, or render binaries instead of HTML. Alternative approaches use request specs, Rack::Test, or the browser download folder.

SameSite cookies

Browser defaults are shifting toward SameSite=Lax, making cross-site cookie behavior stricter and exposing iframe, API, and non-GET request flows that need SameSite=None or Strict.

Ruby: Using named groups in Regex

Named capture groups make complex regular expressions easier to read and extract values from, with match returning nil on no match and named_captures available in Ruby 2.4+.

When reading model columns during class definition, you must handle a missing/empty database

Class definition code that inspects model columns can crash startup when the database is missing or empty, blocking db:create and db:migrate.

ActionMailer: Previewing mails directly in your email client

Inspect Rails emails in a real mail app by exporting a Mail::Message to .eml and opening it, instead of relying only on browser previews.

Carrierwave processing facts

CarrierWave processing runs differently on originals and versions: class-level processing affects only the original file, while callbacks run for each file instance.

Heads up: pg_restore --clean keeps existing tables

pg_restore --clean removes data from dumped tables but leaves extra tables in place, which can break later migrations when restoring a staging dump locally.