Better performance insights with gem `rails_performance`
rails_performance adds low-effort performance monitoring for Rails apps, surfacing slow endpoints, request timing, query breakdowns, and custom events with Redis-backed dashboards.
CarrierWave: Default Configuration and Suggested Changes
CarrierWave defaults often need project-specific tweaks for storage paths, cache cleanup, test isolation, and large-file handling.
Supporting multiple SAML IdPs within a single Rails application
Multi-tenant Rails apps can use one OmniAuth setup for several SAML identity providers, loading the right configuration at runtime for secure SSO.
Selenium: Fix Chrome's "Unsafe Password" Warning
Chrome password leak detection can interrupt Selenium runs with breach warnings on weak or reused credentials. Disabling profile.password_manager_leak_detection suppresses the dialog in automated tests.
Using Passenger Standalone for development
Local development can use Passenger Standalone as a zero-configuration Ruby app server with SSL and production-like behavior, replacing Webrick or Thin.
How to make changes to a Ruby gem (as a Rails developer)
Ruby gems need manual file loading, multi-version support, and their own release workflow, unlike Rails apps. Safe changes depend on understanding structure, tests, versioning, and packaging.
Using the alt attribute and the figcaption element in HTML
Image descriptions need different wording depending on context: alt text should stay functional, while figcaption can be editorial or illustrative.
Using FactoryBot in Development
Dummy development data is faster to create by reusing FactoryBot factories than by using the UI or Rails console records. Defaults, associations, traits, and attribute overrides come along automatically.
Web performance snippets: little scripts that return performance metrics
Tiny scripts provide quick web performance metrics for Core Web Vitals, loading, scripts, images, fonts, and interactions.
Capybara: Waiting for pending AJAX requests after a test
Selenium tests can fail when pending AJAX calls are aborted as Capybara closes the browser tab. Blocking new requests and waiting for in-flight work reduces flaky teardown errors.
Automatically validating dependency licenses with License Finder
Dependency licenses can break closed-source projects when unapproved OSS terms slip in. License Finder validates all dependencies during test runs and flags restricted licenses early.
Shortcuts for getting ids for an ActiveRecord scope
ActiveRecord relations can return only primary keys instead of full records, reducing query payload when just record identifiers are needed.
Testing ActiveRecord validations with RSpec
Rails model validation tests can be written directly with record.validate and error checks, or shortened with shoulda-matchers for standard cases.
CSS variables aka CSS Custom Properties
Live CSS custom properties cascade through the DOM and can be reused in other values, enabling flexible theming and Web Component styling.
Carrierwave: Built-in RSpec matchers
CarrierWave RSpec matchers simplify testing uploaded image versions and dimensions with have_dimensions, be_no_wider_than, and be_no_larger_than.
Output of ParallelTests::Cucumber::FailuresLogger was fixed in 4.9.1
ParallelTests::Cucumber::FailuresLogger now emits valid rerun arguments in version 4.9.1, so patched custom loggers can be removed and the default logger restored.
Controlling smooth scrolling in browsers
Browser scrolling can switch between instant and animated movement depending on CSS, JavaScript options, and user settings; behavior and scroll-behavior interact in surprising ways.
AppArmor in Linux
AppArmor can block daemons after configuration changes, causing misleading file-access errors such as "File not found" or "Can't open file or directory".
Rails: How to get the ordered list of used middlewares
rake middleware reveals the ordered Rails request stack, useful for adding, removing, or profiling middleware that runs on every request.
PostgreSQL: Difference between text and varchar columns
PostgreSQL character columns differ mainly in declared limits, not speed; unbounded varchar and text behave alike in Rails 4+, though some tools still render them differently.
Extracting parts of forms into Unpoly modals/popups
Unpoly popups outside a surrounding form can drop filter values on submit; mirroring inputs between a root form and overlay form preserves pagination and search state.
Changes to positional and keyword args in Ruby 3.0
Ruby 3.0 stops auto-converting hashes to keyword arguments, breaking some method calls and delegation code across Ruby versions.
CarrierWave: How to remove GIF animation
Animated GIF uploads can slow Rails workers and waste processing time; dropping all but the first frame with ImageMagick avoids resizing work.
JavaScript: Comparing objects or arrays for equality (not reference)
JavaScript has no built-in deep equality check for objects and arrays; use _.isEqual(), up.util.isEqual(), or isDeepStrictEqual() for value comparison.