refactor(turbo): use turbo in root controller

This commit is contained in:
Paul Chavard 2022-04-19 12:27:38 +02:00
parent 0bd71ad51a
commit 8d0383c6f8
3 changed files with 3 additions and 2 deletions

View file

@ -84,7 +84,7 @@ class RootController < ApplicationController
respond_to do |format|
format.html { redirect_back(fallback_location: root_path) }
format.js { render js: helpers.remove_element('#outdated-browser-banner') }
format.turbo_stream
end
end

View file

@ -16,6 +16,6 @@
%br
Certaines parties du site ne fonctionneront pas correctement.
.site-banner-actions
= button_to 'Ignorer', dismiss_outdated_browser_path, method: :post, remote: true, class: 'button btn', title: 'Ne plus afficher cet avertissement pendant une semaine'
= button_to 'Ignorer', dismiss_outdated_browser_path, method: :post, form: { data: { turbo: true } }, class: 'button btn', title: 'Ne plus afficher cet avertissement pendant une semaine'
%a.btn.button.primary{ href: "https://browser-update.org/fr/update.html", target: "_blank", rel: "noopener" }
Mettre à jour mon navigateur

View file

@ -0,0 +1 @@
= turbo_stream.remove('outdated-browser-banner')