Details
Description
Please support resource tabs (similar to Coverage, Violations, etc) implemented as Ruby on Rails pages.
I've attached a one line patch that enables this:
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/extension.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/extension.html.erb
@@ -21,3 +21,3 @@
<% else # ruby on rails page %>
- <%= render :inline => @page.getTemplate() %>
+ <%= render :inline => @extension.getTarget().getTemplate() %>
I've also attached a test project with a resource tab implemented in Rails, with an example resource tab implemented in Ruby.
I've filed this as a bug because the reference to rails in resource/extension.html.erb suggests it's supposed to be implemented already.
The test plugin works with the supplied patch. Without the patch, the following error is seen when trying to access the tab:
NoMethodError in Resource#index Showing app/views/resource/extension.html.erb where line #14 raised: undefined method `getTemplate' for nil:NilClass Extracted source (around line #14): 11: <script src="<%= ApplicationController.root_context -%>/deploy/gwt/<%= @extension.getId() -%>/<%= @extension.getId() -%>.nocache.js?<%= sonar_version -%>"></script> 12: <% end %> 13: <% else # ruby on rails page %> 14: <%= render :inline => @page.getTemplate() %> 15: <% end %>