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 2 class ModulesController < ApplicationController
2   -
  3 +
3 4 # GET /modules/metric_history
4 5 def metric_history
5   -
  6 + render :json => {mk: "monkey"}.to_json
6 7 end
7 8  
8 9 end
9 10 \ No newline at end of file
... ...
app/views/repositories/_metric_result.html.erb
... ... @@ -3,8 +3,8 @@
3 3 <% range_snapshot = find_range_snapshot(metric_result) %>
4 4 <tr>
5 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 8 remote: true %></td>
9 9 <td><%= format_grade(metric_result.value) %></td>
10 10 <td><%= metric_configuration_snapshot.weight %></td>
... ...