Rails generates javascript code for sending the call, and the jquery_ujs.js file is added to your layout by default. Then it simply converts all calls with the data-remote=true attribute - it prevents the form from submitting by default and makes an ajax call to the specified href .
source share