From d13ef89afb8b969046fc3e960e9b834ef2b4256e Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Wed, 31 Dec 2025 09:23:36 -0300 Subject: [PATCH] Replace `[data-turbo-cache=false]` with `[data-turbo-temporary]` The default `_error_messages.html.erb` partial uses a deprecated Turbo attribute `data-turbo-cache=false`, which was deprecated on Feb 15 2023 in [this pull request](https://github.com/hotwired/turbo/pull/871). Use more up-to-date attribute name called [data-turbo-temporary](https://github.com/hotwired/turbo/pull/871) to avoid deprecation issues and reduce developer confusion as `data-turbo-temporary` is the only attributed mentioned in [Turbo Drive's documentation](https://turbo.hotwired.dev/handbook/building#preparing-the-page-to-be-cached) Closes #5664 Closes #5662 Signed-off-by: Carlos Antonio da Silva --- CHANGELOG.md | 3 +++ app/views/devise/shared/_error_messages.html.erb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f477421b..12abf235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ [#5645](https://github.com/heartcombo/devise/pull/5645) * Change password instructions button label on devise view from `Send me reset password instructions` to `Send me password reset instructions` [#5515](https://github.com/heartcombo/devise/pull/5515) * Change `
` tags separating form elements to wrapping them in `

` tags [#5494](https://github.com/heartcombo/devise/pull/5494) + * Replace `[data-turbo-cache=false]` with `[data-turbo-temporary]` on `devise/shared/error_messages` partial. This has been [deprecated by Turbo since v7.3.0 (released on Mar 1, 2023)](https://github.com/hotwired/turbo/releases/tag/v7.3.0). + + If you are using an older version of Turbo and the default devise template, you'll need to copy it over to your app and change that back to `[data-turbo-cache=false]`. * enhancements * Add Rails 8 support. diff --git a/app/views/devise/shared/_error_messages.html.erb b/app/views/devise/shared/_error_messages.html.erb index cabfe307..8c9c1711 100644 --- a/app/views/devise/shared/_error_messages.html.erb +++ b/app/views/devise/shared/_error_messages.html.erb @@ -1,5 +1,5 @@ <% if resource.errors.any? %> -

+

<%= I18n.t("errors.messages.not_saved", count: resource.errors.count,