From 9f3c3001568fe296afc02e572c1e28f920b1c265 Mon Sep 17 00:00:00 2001 From: Allen Fair Date: Wed, 1 Jan 2025 10:30:18 -0500 Subject: [PATCH] Adds instructions to disable Turbo on the sign in button When used with Hotwire Turbo, the sign in button processes the link in the background and does not show to the Google Sign In page. This lets developers know how to disable Turbo on the link to process as expected. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ac867fb..4970199 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,14 @@ Which would make the callback `/my_own/google_sign_in_route/callback`. ## Usage -This gem provides a `google_sign_in_button` helper. It generates a button which initiates Google sign-in: +This gem provides a `google_sign_in_button` helper to generate a button which initiates Google sign-in. +When using with Hotwire and Turbo, add the "turbo=false" HTML data attribute to prevent Turbo +from executing it asynchonously. For example: ```erb -<%= google_sign_in_button 'Sign in with my Google account', proceed_to: create_login_url %> +<%= google_sign_in_button 'Sign in with my Google account', + proceed_to: create_login_url, + data: { turbo: "false" } %> <%= google_sign_in_button image_tag('google_logo.png', alt: 'Google'), proceed_to: create_login_url %>