Module: Cms::S3::ApplicationController

Defined in:
lib/bcms_s3/s3_module.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(controller_class) ⇒ Object



21
22
23
# File 'lib/bcms_s3/s3_module.rb', line 21

def self.included(controller_class)
  controller_class.alias_method_chain :url_without_cms_domain_prefix, :www
end

Instance Method Details

#url_without_cms_domain_prefix_with_wwwObject



24
25
26
27
28
29
30
# File 'lib/bcms_s3/s3_module.rb', line 24

def url_without_cms_domain_prefix_with_www
  if Cms::S3.www_domain_prefix
    request.url.sub(/#{cms_domain_prefix}\./,'www.')
  else
    request.url.sub(/#{cms_domain_prefix}\./,'')
  end
end