Restore url_for_static method because it's used by Governance plugin

This commit is contained in:
Julien Lancelot 2016-11-10 08:48:45 +01:00
parent bcd0f171c8
commit 7231cb6490

View File

@ -140,6 +140,24 @@ module ApplicationHelper
Metric.by_key(key)
end
# URL to static resource.
#
# === Optional parameters
#
# * <tt>:plugin</tt> - key of plugin, from where this resource should be loaded.
#
# === Examples
#
# url_for_static(:path => 'images/sonarqube-24x100.png')
# url_for_static(:plugin => 'myplugin', :path => 'image.png')
def url_for_static(options={})
if options[:plugin]
"#{ApplicationController.root_context}/static/#{options[:plugin]}/#{options[:path]}"
else
"#{ApplicationController.root_context}/#{options[:path]}"
end
end
#
#
# Numeric value of variation