Commit 0980581e0e896933d010274f5323cda05efac02c

Authored by Renan Fichberg
Committed by Rafael Manzo
1 parent 670bf614

Ajax communication is now working.

Signed-off By: Guilherme Rojas V. de Lima <guilhermehrojas@gmail.com>
Signed-off By: Fellipe Souto Sampaio <fllsouto@gmail.com>
app/controllers/modules_controller.rb
  1 +require 'json'
1 class ModulesController < ApplicationController 2 class ModulesController < ApplicationController
2 - 3 +
3 # GET /modules/metric_history 4 # GET /modules/metric_history
4 def metric_history 5 def metric_history
5 - 6 + render :json => {mk: "monkey"}.to_json
6 end 7 end
7 8
8 end 9 end
9 \ No newline at end of file 10 \ No newline at end of file
app/views/repositories/_metric_result.html.erb
@@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
3 <% range_snapshot = find_range_snapshot(metric_result) %> 3 <% range_snapshot = find_range_snapshot(metric_result) %>
4 <tr> 4 <tr>
5 <td><%= link_to metric_configuration_snapshot.metric.name, "#metric_#{module_result.id}", 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}", 6 + onclick: "$.get('/modules/metric_history', function( data ) { alert( data['mk'] ); });",
  7 + id: "metric_#{module_result.id}",
8 remote: true %></td> 8 remote: true %></td>
9 <td><%= format_grade(metric_result.value) %></td> 9 <td><%= format_grade(metric_result.value) %></td>
10 <td><%= metric_configuration_snapshot.weight %></td> 10 <td><%= metric_configuration_snapshot.weight %></td>