Webpacker: Side effects of using window.* within the ProvidePlugin
Using window.jQuery in ProvidePlugin can leave jQuery undefined in the browser while $ still works; assigning through global avoids the conflict.
PostgreSQL vs MySQL: How to UPDATE using a JOIN
Updating rows from a related table is needed when backfilling cached data. PostgreSQL and MySQL use different UPDATE join syntax for copying associated values.
How to test Autoprefixer and CSSnext in PostCSS
PostCSS plugin output can be verified by compiling assets and checking Autoprefixer and CSS feature transforms from postcss-preset-env.
Speed up your websites: Put JavaScripts at bottom
Placing JavaScript at the end of the page lets content render sooner in non-client-side apps, reducing perceived load time while keeping scripts centralized.
HTML emails with inline stylesheets and webpacker
HTML emails often break when mail clients ignore external stylesheets. premailer-rails inlines CSS for Rails mailers, and inline image attachments improve compatibility.
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.
MySQL: How to create columns like "bigint" or "longtext" in Rails migrations, and what :limit means for column migrations
Rails migration column sizes depend on type: :limit controls bytes or characters, and certain values map to MySQL tinyint, smallint, mediumint, bigint, text, mediumtext, or longtext.
Github Cheat Sheet
Hidden and lesser-known Git and GitHub features can speed up everyday workflows and reduce friction for version control and collaboration.
During deployment: "You are trying to install in deployment mode after changing your Gemfile"
Deployment can fail with a misleading Gemfile error when the server uses a newer Bundler than the version recorded in Gemfile.lock. Matching Bundler major versions on both sides prevents the install mismatch.
How to doubleclick in Selenium
Capybara tasks can be double-clicked by using Selenium-backed double_click on the matched element; plain Capybara alone does not handle double-clicks.
Why you can't use timezone codes like "PST" or "BST" for Time objects
Timezone abbreviations are ambiguous and often unsupported in Rails time handling; ActiveSupport zone names and offsets avoid wrong parsing, DST mistakes, and misleading displays.
Git: Revert one or more commits
Reverting creates a new commit that undoes earlier changes, useful for backing out a single change or several related commits without rewriting history.
CSS: Flex and "min-width"
Flex items can overflow small screens because min-width:auto prevents shrinking below content size; min-width: 0 lets them fit available space.
Using local fonts with Webpack / Webpacker
Using self-hosted or purchased fonts with Webpack or Webpacker requires either bundling them from assets or packaging them locally for clean imports.
rails_state_machine 1.1.2 released
valid? no longer changes a record's state in rails_state_machine 1.1.2, preventing validation checks from causing unintended transitions.
How to fix parallel_tests with Redis on powerful machines
Parallel test runs can exceed Redis’s default 16 databases on multi-core machines, causing ERR DB index is out of range; increasing the database limit resolves it.
How to fix: Session hash does not get updated when using "merge!"
Rails session hashes can ignore merge!, leaving new values invisible or unsaved. update loads the session for writing and avoids the mismatch.
Bootstrap 4 skin for the Rome datepicker
Make Rome datepicker match Bootstrap 4 with utility classes and custom styling, while preserving Rome’s positioning CSS and internal state handling.
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.
Rails: How to get URL params without routing parameters (or vice versa)
Rails merges query string, request body, and routing data in params; request.query_parameters and request.path_parameters separate URL values from route data.
Micro clearfix mixin for Sass
A float-clearing Sass mixin can avoid extra markup while preserving margin collapse and visible overflow. display: block is a safer clearfix choice than display: table or overflow: hidden.
Copy to clipboard without flash (clipboard.js)
Flash-free copy-to-clipboard handling with clipboard.js, including success and error callbacks, text selection feedback, and support for text fields or data attributes.
JavaScript without jQuery
Moving away from jQuery improves performance, reduces bundle size, and aligns with the modern web platform. Native DOM APIs and polyfills now cover most common needs.
How to install bundler for Ruby < 2.3
Bundler 2 needs Ruby 2.3.0+ and RubyGems 2.5.0+; older Ruby versions require installing the last Bundler 1 release with gem install bundler -v '~>1'.