Commit 670bf6148f207b5ec49c42ede1d6cc1f2ddd5748

Authored by Guilherme Rojas V. de Lima
Committed by Rafael Manzo
1 parent 82f20565

Created controller to get the ajax requisitions from metrics.

app/controllers/modules_controller.rb 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +class ModulesController < ApplicationController
  2 +
  3 + # GET /modules/metric_history
  4 + def metric_history
  5 +
  6 + end
  7 +
  8 +end
0 9 \ No newline at end of file
... ...
app/views/repositories/_metric_result.html.erb
... ... @@ -2,7 +2,10 @@
2 2 <% unless metric_configuration_snapshot.range_snapshot.nil? %>
3 3 <% range_snapshot = find_range_snapshot(metric_result) %>
4 4 <tr>
5   - <td><%= link_to metric_configuration_snapshot.metric.name, "#metric_#{module_result.id}", onclick: "chart_of_the_historic_of_metric(#{metric_result.id},\'#{metric_configuration_snapshot.metric.name}\', \'#{module_result.module.name}\', '12/09/2012,21/10/2013,30/05/2013','12.7,13,20')", id: "metirc_#{module_result.id}" %></td>
  5 + <td><%= link_to metric_configuration_snapshot.metric.name, "#metric_#{module_result.id}",
  6 + onclick: "chart_of_the_historic_of_metric(#{metric_result.id},\'#{metric_configuration_snapshot.metric.name}\', \'#{module_result.module.name}\', '12/09/2012,21/10/2013,30/05/2013','12.7,13,20')",
  7 + id: "metirc_#{module_result.id}",
  8 + remote: true %></td>
6 9 <td><%= format_grade(metric_result.value) %></td>
7 10 <td><%= metric_configuration_snapshot.weight %></td>
8 11 <td><span style="color: #<%= range_snapshot.color %>"><%= range_snapshot.label %></span></td>
... ...
config/routes.rb
... ... @@ -10,7 +10,11 @@ Mezuro::Application.routes.draw do
10 10 put '/repositories/:id' => 'repositories#update', as: :repository_update
11 11 end
12 12  
  13 + #resources :modules
  14 + get '/modules/metric_history' => 'modules#metric_history'
  15 +
13 16 root "home#index"
  17 +
14 18 # The priority is based upon order of creation: first created -> highest priority.
15 19 # See how all your routes lay out with "rake routes".
16 20  
... ...