mirror of
https://github.com/SonarSource/sonarqube.git
synced 2024-09-13 15:45:52 +02:00
Restore url_for_static method because it's used by Governance plugin
This commit is contained in:
parent
bcd0f171c8
commit
7231cb6490
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user