Simply returning success or failure from ajax call in rails

Viewed 32056

I have a little ajax call that calls rails:

    $.ajax({
        type: "POST",
        url: '...',
        data: ({    ...
                }),
        success:    function(response, status) {
                    console.log(status);
        }
     });

In the rails controller I'm simply deleting an entry from the database, and I simply want to return if it was successful or not. What's the best way?

Should I just return JSON in respond_to? If so, what exactly would you have it contain?

4 Answers
Related