Using ActiveRecord with threads might use more database connections than you think

ActiveRecord threads can open one database connection per thread, quickly exhausting server limits. Rails reuses and releases connections automatically, but manual cleanup is sometimes needed.

Capybara: Preventing server errors from failing your test

Capybara can fail tests after all steps when the Rails server raises an error on session cleanup. Filtering known missing-file errors avoids false failures.

Decide whether cronjobs should run on one or all servers

Cron jobs sometimes need to run on exactly one server or on every server; whenever_roles can separate shared tasks from single-host tasks.

Caching in Rails < 6.1 may down parts of your application when using public cache control

Public cache control can serve the wrong MIME type and enable cache poisoning when responses vary by Accept; Vary: Accept prevents stale or mismatched cached content.

Toggling a maintenance page with Capistrano

Capistrano can switch an app into maintenance mode by publishing a static page on each web server, with customizable message, timing, and template.

Tracking External API Performance in Rails Logs

Track time, call counts, and token usage for slow external APIs in Rails logs and Server Timing, making LLM regressions and prompt bloat visible without a debugger.

Using ngrok for exposing your development server to the internet

Temporary public access to a localhost development server is useful for testing on another device or through TLS without port forwarding or self-signed certificates.

Capistrano: How to find out which version of your application is currently live

Capistrano stores the deployed commit hash in REVISION, making the live release easy to identify on one server or across multiple hosts.

DNS debug tools

DNS lookup tools help diagnose domain resolution, showing addresses, name servers, and resolver responses with different levels of detail.

Clean up application servers when deploying

Frequent deployments fill application servers with old releases, tmp files, and stale compiled assets. Capistrano can automate release and asset cleanup to prevent disk-space exhaustion.

How to find out what is running on a port on a remote machine

Remote ports can hide unexpected services, and nmap can identify the daemon and version behind a TCP port. Useful when a server exposes the wrong service or response.

How to run a small web server (one-liner)

Quickly serve a local folder for testing, or boot a Rack app, with one-line commands in Ruby, Python, Passenger, or Puma; HTTPS is possible too.

HTML forms with multiple submit buttons

Forms can offer multiple submit actions such as save, accept, or reject, but the server must know which button was pressed. formaction sends each button to a different URL.

How to Work With Time Zones in Rails

Rails uses configurable time zones, while Ruby time APIs follow the server zone and can return wrong results. Time.zone keeps date and time handling consistent.

A modern approach to SVG icons

SVG icons can be sized and colored like text without image tags, icon fonts, or extra server work by using CSS masking.

How to search through logs on staging or production environments

Finding a request in staging or production logs often requires searching several servers and archived files; grep or zgrep can query current and zipped logs.

How to silence Puma for your feature tests

Feature specs can print noisy Puma startup logs when Capybara launches the test server. Setting Capybara.server = :puma, { Silent: true } suppresses the output.

Unpoly + Nested attributes in Rails: A short overview of different approaches

Rails nested attributes become cumbersome with dynamic subrecords; Unpoly enables friendlier add/remove workflows without losing server-side validation and form helpers.

Capistrano task to edit staging / production credentials

Editing Rails credentials for staging or production requires server-only secret keys; a Capistrano task opens the decrypted file without copying keys to a dev machine.

A quick introduction to CORS

Cross-origin browser requests need explicit server approval; otherwise the Same-Origin Policy blocks access. CORS uses Origin and Access-Control-Allow-Origin headers, with preflight checks for some methods.

How to upgrade Rails: Workflow advice

Upgrading Rails across major versions needs staged updates, compatible Ruby and gem versions, and repeated checks in console, server, tests, and config defaults.

Capistrano 3: Running a command on all servers

Capistrano 3 can execute an arbitrary shell command across all app servers, useful for grepping logs or bulk remote checks.

Don't assert exceptions in feature specs

Capybara feature specs do not reliably catch server exceptions in another thread; request specs or visible UI assertions fit this user-level behavior better.

Devise: Invalidating all sessions for a user

Stolen Rails session cookies can remain usable after logout with Devise. Invalidating them requires changing the authentication salt, resetting the password, or storing sessions server-side.