Module: Locomotive::DashboardHelper

Defined in:
app/helpers/locomotive/dashboard_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_site_urlObject


4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/locomotive/dashboard_helper.rb', line 4

def current_site_url
  if current_site.domains.blank?
    preview_url(current_site)
  else
    protocol = current_site.redirect_to_https? ? 'https' : 'http'
    URI.join("#{protocol}://" + current_site.domains.first).tap do |uri|
      uri.port = request.port if request.port != 80 && request.port != 443
    end.to_s
  end
end