Hello everyone, tell me what functions there are to find out the error when saving data. I get the data myself using the Jquery method serialize () and then send it via Ajax to the controller but they do not want to be saved to the database
$('#add_new_player').click(function(event) { event.preventDefault() $.ajax({ url:"/Group/Players/add_player", success:function(data) { pl_dialog.html(data) pl_dialog.dialog("open") $('#close_dialog_pl').click(function() { pl_dialog.dialog("close") }) $('#add_player').click(function() { var data = $('#AddForm').serialize() $.post("/Group/Players/player_save", {data:data}) }) } }); });
Here is the controller code
function player_save() { if (!empty($this -> request -> data)) { $this -> Player -> save($this -> request -> data); } }