Active Admin says you can change the site title this way:
Site Title Options You can update the title or use an optional image in the initializer also. In addition you can set the link. By default there is no link and the title is set to the name of your Rails.application class name.
# config/initializers/active_admin.rb
config.site_title = "My Admin Site"
config.site_title_link = "/" ## Rails url helpers do not work here
config.site_title_image = "site_log_image.png"
Also, they say you can configure titles by namespace as follows:
ActiveAdmin.setup do |config|
config.site_title = "My Default Site Title"
config.namespace :admin do |admin|
admin.site_title = "Admin Site"
end
config.namespace :super_admin do |super_admin|
super_admin.site_title = "Super Admin Site"
end
end
I'm building a multi tenant site and I want the site_title to be based on the current tenant name. Is there a way to put a dynamic field in there that changes based on the tenant?
Thanks
I know this is an old question but I've just discovered that you can do the following in the current master of ActiveAdmin:
# config/initializers/active_admin.rb
ActiveAdmin.setup do |config|
...
config.site_title = ->(view) {
# Return what you like from this lambda. Runs in the scope of the controller so you can call your helpers directly.
# For example, I do something like:
administrator_signed_in? ? current_tennant.name : "My Site's Generic Name"
}
...
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With