Files
fizzy/app/helpers/application_helper.rb
T
Mike Dalessio 90d475245e Update page_title_tag to match JZ's expectations
and add some tests
2025-11-08 11:07:07 -05:00

19 lines
593 B
Ruby

module ApplicationHelper
def page_title_tag
account_name = if ApplicationRecord.current_tenant && Current.session&.identity&.memberships&.many?
Account.sole&.name
end
tag.title [ @page_title, account_name, "Fizzy" ].compact.join(" | ")
end
def icon_tag(name, **options)
tag.span class: class_names("icon icon--#{name}", options.delete(:class)), "aria-hidden": true, **options
end
def inline_svg(name)
file_path = "#{Rails.root}/app/assets/images/#{name}.svg"
return File.read(file_path).html_safe if File.exist?(file_path)
"(not found)"
end
end