I am using this function try to make a request to the server. I am wondering how could I get data sent by Jquery Ajax in Rails controller.
function addnote(){
$.ajax({
type: "POST",
url:SERVER_URL+"api/addNotes/",
data: {note_text: $('#note_text').val(), note_lat: $('#lat').val(), note_lng: $('#lng')},
success: function(data, textStatus, jqXHR) {
},
error: function(jqXHR, textStatus, errorThrown) {
alert("Error=" + errorThrown);
}
});
Here is my rails controller
def add_notes
end
end