diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 84356ec..8ad6fbc 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -713,4 +713,8 @@ module ApplicationHelper
url_for(options)
end
+ def base_url
+ environment.top_url(request.ssl?)
+ end
+
end
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 67d2d51..d3a13a6 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -256,8 +256,9 @@ class Environment < ActiveRecord::Base
end
end
- def top_url
- result = "http://#{default_hostname}"
+ def top_url(ssl = false)
+ protocol = (ssl ? 'https' : 'http')
+ result = "#{protocol}://#{default_hostname}"
if Noosfero.url_options.has_key?(:port)
result << ':' << Noosfero.url_options[:port].to_s
end
diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml
index e6de041..43901d0 100644
--- a/app/views/layouts/application.rhtml
+++ b/app/views/layouts/application.rhtml
@@ -50,7 +50,7 @@
<%# FIXME %>
<%= stylesheet_link_tag '/designs/icons/default/style.css' %>
-
+