2

I'm using button_to in a page for downloading a PDF file.

= button_to "Download Report", evaluation_report_attempt_path, method: :get, class: "btn btn-primary", data: { disable_with: "Downloading..."}

There is no page redirection happening here. After the file is downloaded, the button remains disabled. How do I re-enable the button after the function is completed?

Mithesh M
  • 21
  • 2

1 Answers1

0

Yo can try these

$(window).unload(function() {
  $.rails.enableFormElements($($.rails.formSubmitSelector));
});
lg86
  • 350
  • 2
  • 7