Dev News Daily ENDE

Rails 8.2 defaults will compile HTML templates with Herb instead of Erubi

This Week in Rails for 25 September, written after Rails World in Austin, lists the changes that landed on Rails main in the preceding seven days. The one most application developers will meet is a new framework default for how templates are compiled.

config.action_view.erb_implementation now accepts :herb or :erubi, and the framework defaults for Rails 8.2 set :herb. New applications, and existing ones that run config.load_defaults 8.2, will compile HTML templates through ERB::Herb and every other format through Erubi. Herb is an HTML-aware ERB tooling project, and the same week also changed a checker so that behaviour is consistent across Herb versions.

Two deprecations arrived alongside. supports_datetime_with_precision?, added eleven years ago to gate the :precision option on datetime and time columns, is no longer needed because every database Active Record supports now handles precision - MySQL 5.5 support was dropped two years ago. And the CALLBACKS constant, long outdated and referenced only in tests, is deprecated with no replacement and will be removed in Rails 9; the newsletter notes that anything driven off it silently skips callbacks such as before_commit.

Among the fixes: non-ASCII defaults in a template's strict locals: magic comment rendered the wrong characters when the template body was ASCII-only, without raising; BroadcastLogger#tagged now works when broadcasting to several tagging loggers; ActionController::ParamsWrapper options are made safe for Ractors; and a PostgreSQL foreign-key check now qualifies its cast with the schema.

Rails 8.2 defaults will compile HTML templates with Herb instead of Erubi
Rails 8.2 defaults will compile HTML templates with Herb instead of Erubi — Dev News Daily

What it means

Changing the default template compiler is a bigger step than its one-line configuration suggests. An HTML-aware engine can understand the structure of the markup it produces, which opens the way to better error messages and tooling than a text-based ERB compiler can offer. It also means templates that relied on quirks of Erubi may behave differently once an application adopts 8.2 defaults.

Because it is a framework default rather than a forced change, teams can opt in deliberately: set erb_implementation explicitly, run the test suite, and look for rendering differences before flipping load_defaults. The CALLBACKS deprecation is worth a search too - code that uses it has been missing callbacks all along.

Primary source
This Week in Rails - 25 September 2026
https://rubyonrails.org/2026/9/25/this-week-in-rails