Rework toggle as switch

This commit is contained in:
Jason Zimdars
2025-12-01 23:13:54 -06:00
parent aec8747710
commit 7b7b3f8a67
2 changed files with 23 additions and 14 deletions
-9
View File
@@ -2,13 +2,4 @@ module AccountsHelper
def account_logo_tag(style: nil)
tag.figure image_tag(fresh_account_logo_path, alt: "Account logo", size: 300), class: "account-logo avatar #{style}"
end
def button_to_toggle_setting(label, setting)
button_to account_path(account: { settings: { setting => !Current.account.settings.send("#{setting}?") } }),
method: :put,
role: "checkbox", aria: { checked: true, labelledby: "#{setting}_account_setting" }, tabindex: 0,
class: "btn" do
tag.span(label, id: "#{setting}_account_setting")
end
end
end