<% if @result.content_is_ready? %>
  clearInterval(window.nexaas_async_interval);

  <% if @result.is_file? %>
    $('#js-nexaas-async-collector-loading-<%= @unique_id %>').remove();
    window.location.href = '<%= async_resource_path(params[:id], format: @result.extension) %>';
  <% else %>
    $('#js-nexaas-async-collector-loading-<%= @unique_id %>').remove();
    $('#js-nexaas-async-collector-<%= @unique_id %>').parent().append("<%= escape_javascript(@result.content.force_encoding('UTF-8').html_safe) %>");
    $('#js-nexaas-async-collector-<%= @unique_id %>').remove()
    $('#js-nexaas-async-collector-style-<%= @unique_id %>').remove()
  <% end %>
<% end %>

<% if @result.content_is_ready? %>
  clearInterval(window.nexaas_async_interval);

  <% if @result.is_file? %>
    $('#js-nexaas-async-collector-loading-<%= @unique_id %>').remove();
    window.location.href = '<%= nexaas_async_collector.async_resource_path(params[:id], format: @result.extension) %>';
  <% else %>
    $('#js-nexaas-async-collector-loading-<%= @unique_id %>').remove();
    $('#js-nexaas-async-collector-<%= @unique_id %>').parent().append("<%= escape_javascript(@result.content.force_encoding('UTF-8').html_safe) %>");
    $('#js-nexaas-async-collector-<%= @unique_id %>').remove()
    $('#js-nexaas-async-collector-style-<%= @unique_id %>').remove()
  <% end %>
<% end %>

Remove DEPERECATION warning and fix bug when trying to generate and download data through browser
Remove DEPERECATION warning and fix bug when trying to generate and download data through browser
