vendredi 25 septembre 2015

Disable javascript UJS caching (Rails 4)

I am using Rails 4 and unobstrusive javascript(UJS) to make a ajax call:

I'd like to disable the caching so that if somebody clicks the same link again and that the content in databse has changed, a new content will load inside the modal.

Some people do:

$.ajaxSetup ({
    // Disable caching of AJAX responses
    cache: false
});

How to write this with Rails?

<%= link_to "view", show_opportunities_path, remote: true, cache: false %> does not work.

Aucun commentaire:

Enregistrer un commentaire