After selecting a row in my table, I aim to update a variable in the view using JavaScript. Here is the function I currently have:
$("#myTable tr").click(function(){
var rowData = $(this).children("td").map(function() {
return $(this).text();
}).get();
var id = $.trim(rowData[0]);
$.ajax({
...
});
})
I'm looking to send the "id" variable to the controller for updating in the view. However, I'm unsure of what to include within the ajax call and the controller. I understand that I'll need to use a respond_to, but I'm uncertain about the additional steps.