aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-09-27 10:09:23 +0000
committerGodin <mandrikov@gmail.com>2010-09-27 10:09:23 +0000
commit3727f84e84453381a51ae40a6e804520e6d0d31a (patch)
treef72418416d6664d44ba603ea215684a4f8f630c9 /sonar-server
parent1cbc025312c171925195046d2601a59d2c858e49 (diff)
downloadsonarqube-3727f84e84453381a51ae40a6e804520e6d0d31a.tar.gz
sonarqube-3727f84e84453381a51ae40a6e804520e6d0d31a.zip
SONAR-1709:
* Add ruby-helper for URL construction for static resources from plugins * Add integration test
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
index f8997db4be1..bb1934c9e3f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
@@ -144,6 +144,15 @@ module ApplicationHelper
Metric.by_key(key)
end
+ # URL to static resource from plugin.
+ #
+ # === Examples
+ #
+ # url_for_static(:plugin => 'myplugin', :path => 'image.png')
+ def url_for_static(options={})
+ "#{ApplicationController.root_context}/static/#{options[:plugin]}/#{options[:path]}"
+ end
+
def url_for_gwt(page)
"#{ApplicationController.root_context}/plugins/home/#{page}"
end