Files
grecia/app/components/layout/common_html_attributes_component.rb
Javi Martín f8f6844ec3 Simplify common HTML attributes using tag.attributes
The `tag.attributes` method was introduced in Rails 7.0.
2024-07-22 18:35:35 +02:00

22 lines
382 B
Ruby

class Layout::CommonHtmlAttributesComponent < ApplicationComponent
use_helpers :rtl?
private
def attributes
tag.attributes(dir: dir, lang: lang, class: html_class)
end
def dir
"rtl" if rtl?
end
def lang
I18n.locale
end
def html_class
"tenant-#{Tenant.current_schema}" if Rails.application.config.multitenancy
end
end