Module: Railings::RoutingHelper

Defined in:
lib/railings/routing_helper.rb

Instance Method Summary collapse

Instance Method Details

#url_for_root(options) ⇒ Object



3
4
5
# File 'lib/railings/routing_helper.rb', line 3

def url_for_root options
  request.subdomain.present? ? options.merge!(:host => with_subdomain, :only_path => false) : options
end

#with_subdomain(subdomain = '') ⇒ Object



7
8
9
10
11
# File 'lib/railings/routing_helper.rb', line 7

def with_subdomain subdomain = '' 
  subdomain ||= ''
  subdomain += "." unless subdomain.empty?  
  [subdomain, request.domain, request.port_string].join  
end