$('#ranking-table').replaceWith("<%= j(render partial: 'gobierto_budgets/places/ranking_table') %>")
$('.pagination').replaceWith("<%= j(paginate @ranking_items, remote: true) %>")

function updatePageUrl() {
  history.pushState(null, '', "<%= request.url %>");
}

function updateDataEndpointPath() {
  $('[data-ranking-url]').data('ranking-url', "<%= request.path %>");
}

updatePageUrl();
updateDataEndpointPath();

$('#ranking-table').replaceWith("<%= j(render partial: 'gobierto_budgets/places/ranking_table') %>")
$('.pagination').replaceWith("<%= j(paginate @ranking_items, remote: true) %>")

function updatePageUrl() {
  history.pushState({ turbolinks: {} }, '', "<%= request.url %>");
}

function updateDataEndpointPath() {
  $('[data-ranking-url]').data('ranking-url', "<%= request.path %>");
}

updatePageUrl();
updateDataEndpointPath();

Fix turbolinks issues with browser back button
Fix turbolinks issues with browser back button
