Hello everybody,
I'm struggling with this right here. I want to pass an id from view to a controller function so I can delete a record from database.
So far this is what I got.
I would appreciate some light on this because I don't know what I'm doing wrong.
Thanks!
view
$('#warning').on('click', function(){
var iduser= $('#id').val();
ajax('{{=URL('Tools', 'userdelete', args=)}}' , [], iduser);
})
controller (Tools.py)
def userdelete():
rec-id = request.args(0)
crud.delete(db.People, rec-id, message=T('Deleted'))