2015-03-09 15:24:16 -04:00
|
|
|
module GlobalPath
|
|
|
|
def path(p)
|
|
|
|
"#{GlobalSetting.relative_url_root}#{p}"
|
|
|
|
end
|
2015-05-26 01:41:50 -04:00
|
|
|
|
|
|
|
def cdn_path(p)
|
|
|
|
"#{GlobalSetting.cdn_url}#{path(p)}"
|
|
|
|
end
|
2016-02-04 21:05:47 -05:00
|
|
|
|
|
|
|
def cdn_relative_path(path)
|
|
|
|
if (cdn_url = GlobalSetting.cdn_url).present?
|
|
|
|
URI.parse(cdn_url).path + path
|
|
|
|
else
|
|
|
|
path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-03-09 15:24:16 -04:00
|
|
|
end
|