From: Godin Date: Mon, 27 Sep 2010 12:09:38 +0000 (+0000) Subject: SONAR-1709: in ruby-helper parameter :plugin should be optional X-Git-Tag: 2.6~937 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6ab9363b7bc65621673bbf0fda658536e0aaf73a;p=sonarqube.git SONAR-1709: in ruby-helper parameter :plugin should be optional --- 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 bb1934c9e3f..d728ba39ec7 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,13 +144,22 @@ module ApplicationHelper Metric.by_key(key) end - # URL to static resource from plugin. + # URL to static resource. + # + # === Optional parameters + # + # * :plugin - key of plugin, from where this resource should be loaded. # # === Examples # + # url_for_static(:path => 'images/sonar.png') # url_for_static(:plugin => 'myplugin', :path => 'image.png') def url_for_static(options={}) - "#{ApplicationController.root_context}/static/#{options[:plugin]}/#{options[:path]}" + if options[:plugin] + "#{ApplicationController.root_context}/static/#{options[:plugin]}/#{options[:path]}" + else + "#{ApplicationController.root_context}/#{options[:path]}" + end end def url_for_gwt(page)