Module: Zena::Use::Urls::ViewAndControllerMethods

Included in:
ControllerMethods, ViewMethods
Defined in:
lib/zena/use/urls.rb

Overview

Common

Instance Method Summary collapse

Instance Method Details

#host_with_portObject



295
296
297
298
299
300
301
302
303
304
# File 'lib/zena/use/urls.rb', line 295

def host_with_port
  @host_with_port ||= begin
    port = request.port
    if port.blank? || port.to_s == '80' || port.to_s == '443'
      current_site.host
    else
      "#{current_site.host}:#{port}"
    end
  end
end

#http_protocolObject



306
307
308
309
310
311
312
313
314
# File 'lib/zena/use/urls.rb', line 306

def http_protocol
  @http_protocol ||= begin
    if request.protocol =~ /^(.*):\/\/$/
      $1
    else
      'http'
    end
  end
end