diff options
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb | 13 |
1 files changed, 11 insertions, 2 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 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 + # + # * <tt>:plugin</tt> - 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) |