From f8de70ee2d629ac34395902dbee724c21297960c Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 8 Sep 2023 18:59:58 +0200 Subject: [PATCH] Allow flash messages in Turbo streams --- lib/hcaptcha/adapters/controller_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hcaptcha/adapters/controller_methods.rb b/lib/hcaptcha/adapters/controller_methods.rb index 951d160f..98c9c5ae 100644 --- a/lib/hcaptcha/adapters/controller_methods.rb +++ b/lib/hcaptcha/adapters/controller_methods.rb @@ -67,7 +67,7 @@ def hcaptcha_error(model, attribute, message) end def hcaptcha_flash_supported? - request.respond_to?(:format) && request.format == :html && respond_to?(:flash) + request.respond_to?(:format) && %i[html turbo_stream].include?(request.format.to_sym) && respond_to?(:flash) end # Extracts response token from params. params['h-captcha-response'] should either be a