Module: KirguduBase::UrlHelper

Included in:
ApplicationController
Defined in:
app/helpers/kirgudu_base/url_helper.rb

Instance Method Summary collapse

Instance Method Details

#url_for(options = nil) ⇒ Object



11
12
13
14
15
16
# File 'app/helpers/kirgudu_base/url_helper.rb', line 11

def url_for(options = nil)
	if options.kind_of?(Hash) && options.has_key?(:subdomain)
		options[:host] = with_subdomain(options.delete(:subdomain))
	end
	super
end

#with_subdomain(subdomain) ⇒ Object



5
6
7
8
9
# File 'app/helpers/kirgudu_base/url_helper.rb', line 5

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