Identify the current tenant in the <html> tag
This way it will be possible to write CSS and JavaScript code that will only apply to specific tenants. Note that CSS customization is still limited because it isn't possible to use different SCSS variables per tenant.
This commit is contained in:
@@ -4,7 +4,7 @@ class Layout::CommonHTMLAttributesComponent < ApplicationComponent
|
||||
private
|
||||
|
||||
def attributes
|
||||
sanitize([dir, lang].compact.join(" "))
|
||||
sanitize([dir, lang, html_class].compact.join(" "))
|
||||
end
|
||||
|
||||
def dir
|
||||
@@ -14,4 +14,8 @@ class Layout::CommonHTMLAttributesComponent < ApplicationComponent
|
||||
def lang
|
||||
"lang=\"#{I18n.locale}\""
|
||||
end
|
||||
|
||||
def html_class
|
||||
"class=\"tenant-#{Tenant.current_schema}\"" if Rails.application.config.multitenancy
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user