From 75b93d35355892b51af942c02185e7cb95dfb820 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 15 Jan 2022 06:28:29 +0100 Subject: [PATCH] Use `button_to` helper to generate a proper logout button --- app/views/navigation/main/_profile.haml | 2 +- app/views/navigation/mobile/_profile.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/navigation/main/_profile.haml b/app/views/navigation/main/_profile.haml index ae054665..b4359080 100644 --- a/app/views/navigation/main/_profile.haml +++ b/app/views/navigation/main/_profile.haml @@ -32,6 +32,6 @@ %i.fa.fa-fw.fa-gavel = t('views.navigation.moderation') .dropdown-divider - %a.dropdown-item{ href: destroy_user_session_path, data: { method: :delete } } + = button_to destroy_user_session_path, method: 'delete', class: 'dropdown-item' do %i.fa.fa-fw.fa-sign-out = t 'views.sessions.destroy' diff --git a/app/views/navigation/mobile/_profile.haml b/app/views/navigation/mobile/_profile.haml index f4177cde..693537c9 100644 --- a/app/views/navigation/mobile/_profile.haml +++ b/app/views/navigation/mobile/_profile.haml @@ -26,6 +26,6 @@ %i.fa.fa-fw.fa-gavel = t('views.navigation.moderation') .dropdown-divider - %a.dropdown-item{ href: destroy_user_session_path, data: { method: :delete } } + = button_to destroy_user_session_path, method: 'delete', class: 'dropdown-item' do %i.fa.fa-fw.fa-sign-out = t 'views.sessions.destroy'