From 0980581e0e896933d010274f5323cda05efac02c Mon Sep 17 00:00:00 2001 From: Renan Fichberg Date: Mon, 11 Nov 2013 17:21:11 -0200 Subject: [PATCH] Ajax communication is now working. --- app/controllers/modules_controller.rb | 5 +++-- app/views/repositories/_metric_result.html.erb | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/modules_controller.rb b/app/controllers/modules_controller.rb index 6896737..cb5c101 100644 --- a/app/controllers/modules_controller.rb +++ b/app/controllers/modules_controller.rb @@ -1,8 +1,9 @@ +require 'json' class ModulesController < ApplicationController - + # GET /modules/metric_history def metric_history - + render :json => {mk: "monkey"}.to_json end end \ No newline at end of file diff --git a/app/views/repositories/_metric_result.html.erb b/app/views/repositories/_metric_result.html.erb index cd64484..b590fea 100644 --- a/app/views/repositories/_metric_result.html.erb +++ b/app/views/repositories/_metric_result.html.erb @@ -3,8 +3,8 @@ <% range_snapshot = find_range_snapshot(metric_result) %> <%= 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}", + onclick: "$.get('/modules/metric_history', function( data ) { alert( data['mk'] ); });", + id: "metric_#{module_result.id}", remote: true %> <%= format_grade(metric_result.value) %> <%= metric_configuration_snapshot.weight %> -- libgit2 0.21.2