Open FrankHald opened 8 years ago
Addind the following in the application.js does the job:
var ready = function(){
$("#filterrific_filter").click(function(){
$.get($("#filterrific_filter").attr("action"), $("#filterrific_filter").serialize(), null, "script");
history.pushState(null, document.title, $("#filterrific_filter").attr("action") + "?" + $("#filterrific_filter").serialize());
e.preventDefault();
});
$(window).bind("popstate", function() {
$.getScript(location.href);
});
};
$(document).ready(ready);
$(document).on('page:load', ready);
@FrankHald tnx for sharing this snippet!
Just a few questions:
$.get($("#filterrific_filter").attr("action"), $("#filterrific_filter").serialize(), null, "script");
You are making a request and discarding the response as far as I can tell?
So that its possible to bookmark the url or copy-paste it to recreate the same search criteria