Module: Vhost::ApplicationHelperExtensions

Defined in:
lib/vhost/application_helper_extensions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/vhost/application_helper_extensions.rb', line 2

def self.included(receiver)
  # This swaps out the 'subtitle' method for the 'site_hostname'
  # method to show the hostname in the subtitle in admin...
  receiver.send :alias_method_chain, :subtitle, :site_hostname
  
  receiver.send :define_method, :site_admin? do
    current_user and current_user.site_admin?
  end
end

Instance Method Details

#subtitle_with_site_hostnameObject



12
13
14
# File 'lib/vhost/application_helper_extensions.rb', line 12

def subtitle_with_site_hostname
  current_site.title
end