diff options
author | Godin <mandrikov@gmail.com> | 2010-09-27 12:09:38 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-09-27 12:09:38 +0000 |
commit | 6ab9363b7bc65621673bbf0fda658536e0aaf73a (patch) | |
tree | 145508a2a648dd9c825c1f3c87fb0cbb30680abc /sonar-server/src/main/webapp/WEB-INF/app/helpers | |
parent | 929f517b8c3b8430d68802b0ff2bd32e2d59f3df (diff) | |
download | sonarqube-6ab9363b7bc65621673bbf0fda658536e0aaf73a.tar.gz sonarqube-6ab9363b7bc65621673bbf0fda658536e0aaf73a.zip |
SONAR-1709: in ruby-helper parameter :plugin should be optional
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/helpers')
-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) |