I am currently facing an issue with making an ajax call to my controller
class PatientRecordController < ApplicationController
def export
....
end
end
Within my javascript file, the code snippet is as follows:
$(document).ready(function(){
freezeTopRow($('#dataTable'));
$("#export").click(function(){
$.ajax({url: "patient_record/export", type: "POST"});
});
});
Despite inspecting element and debugging, when I click on the 'export' tag on my page, the function gets called but fails to reach the controller.
Interestingly, I have another set of 2 controllers and views wherein the same process works perfectly fine.