Concurrency issues with find-as-you-type boxes
Live search boxes can show stale results when AJAX responses arrive out of order, causing flashing and mismatched suggestions. Serializing requests or discarding outdated responses avoids the race condition.
Migration from the Asset Pipeline to Webpacker
Moving a Rails app from the Asset Pipeline to Webpacker requires inventorying bundled libraries, repackaging legacy assets, and adjusting deployment for pack-based assets.
Better numeric inputs in desktop browsers
Desktop number fields accept scientific notation, arrow-key changes, wheel scrolling, and stray letters, causing accidental edits and validation errors.
Enabling YJIT
Ruby's JIT compiler needs a YJIT-enabled build and explicit activation; Rails 7.2+ enables it after boot, usually making it active already.
The TCF 2.0 (Tranparency and Consent Framework) standard, and what you should know about it
GDPR-compliant ad consent requires a registered CMP, consent strings, and __tcfapi so vendors can verify user choices before serving personalized ads.
Local development with SSL and Puma
Local HTTPS for Puma development needs a trusted certificate and SSL binding so Rails runs on https://localhost:3000 without browser warnings.
Error handling and reporting with Rails
Rails exception handling can either crash requests, hide actionable errors, or spam trackers; ExceptionApp, DebugExceptions, and the error reporter shape responses, logging, and notifications.
Baseline npm security
Compromised npm packages and malicious install hooks can leak secrets or run malware; cooldowns, blocked git sources, script disabling, and careful npx use reduce supply-chain risk.
How to auto-rotate images before OCR or computer vision tasks
Rotate scanned pages to upright before OCR or vision LLM processing; Tesseract OSD with sector probing improves orientation detection when pages are sideways, upside down, or noisy.
Customize your Bash prompt
Bash prompt customization relies on PS1 escape sequences, colors, and command output to show user, host, directory, git branch, and status information.
Deliver Paperclip attachments to authorized users only
Private Paperclip downloads need restricted storage or hashed URLs to keep attachments away from public access. A controller-based delivery path or secret-based paths reduce exposure.
ActiveRecord: String and text fields should always validate their length
String and text columns need model length validation to prevent database exhaustion and avoid runtime SQL errors on oversized input.
Use <input type="number"> for numeric form fields
Numeric form fields on mobile get digit-focused keyboards, locale-aware decimal display, and consistent point-based values in JavaScript and form submission.
Using the ActiveSupport::BroadcastLogger
ActiveSupport::BroadcastLogger sends one log message to multiple outputs, useful for writing Rails and Sidekiq logs to both STDOUT and files.
Test your application's e-mail spam scoring with mail-tester.com
Check outbound mail for spam filters and deliverability issues with mail-tester.com; a score around 9/10 is usually fine, while plain-text bodies and proper DNS help avoid false positives.
Capistrano: creating a database dump if migrating
Create a database dump only when Capistrano will run Rails migrations, using conditional migration checks and a deploy hook.
Upgrade guide for moving a Rails app from Webpack 3 to Webpack 4
Webpacker 4 and Babel 7 change config files, package names, asset paths, and polyfill imports when upgrading a Rails app from Webpack 3.
Gatekeeping: Guide for gatekeeper
Project code is reviewed before staging to catch client rejections early and keep changes maintainable. Gatekeepers approve or reject merge requests and decide whether a review is needed.
whenever: Installing cron jobs only for a given Rails environment or Capistrano stage
Conditional cron jobs in whenever can target only one Rails environment or Capistrano stage, avoiding unwanted tasks on other deployments.
Using Low-Level Prompts for High-Accuracy AI Coding
Precise, low-level prompts and tight context improve AI code edits across files; structured keywords, reusable patterns, and early review reduce guesses and errors.
Capybara: Most okayest helper to download and inspect files
Reliable file-download testing in Capybara, including filename, content type, disposition, and text inspection across Selenium and Rack::Test without leaving the page.
MySQL replication how-to
Setting up MySQL master-slave replication is error-prone, especially with initial data dumps, binary log positions, and SSH tunnels for remote connectivity.
How to make Webpacker compile once for parallel tests, and only if necessary
Compile Webpacker assets once in parallel test runs and skip recompilation when files are unchanged, avoiding duplicate work and Capybara timeouts.
Capistrano: Configure environment specific array attributes
Capistrano can adjust array-style settings per environment, letting deployments add or remove linked files without duplicating the base configuration.