Reputation: 48453
I am playing with FIlePicker, where are all requests made in Javascript. For example, for removing a file I have to call this snippet:
console.log("Storing...");
filepicker.store("Test text", function(InkBlob){
console.log("Removing...");
filepicker.remove(InkBlob, function(){
console.log("Removed");
});
});
But how can I process this code in Rails? For example I have a list of files, where is a link for removing a file, how can I process the code above (the code above will delete the physical file) + update some data in database (UPDATE/DELTE)?
Could anyone give me some tips how to do that?
Upvotes: 0
Views: 115
Reputation: 48599
Could anyone give me some tips how to do that?
If you want the server side to be aware of what the client side is doing, then you need to make the client side send the server side a message. You can do that with ajax. So after your filepicker.remove() line, insert a jquery ajax call.
Upvotes: 1