Rails automatically disables buttons when submitting a form. This works fine most of the time: for AJAX requests, it enables them again after the request is complete, and for non-AJAX requests, the button is replaced by a new element when the new page loads. However, there's an exception. When a request returns data so users can download a fire, the request is not an AJAX one and the button is not replaced. So users are left with a disabled button they can no longer click. So in this case, we aren't disabling the button after a user clicks it.
20 lines
685 B
Plaintext
20 lines
685 B
Plaintext
<h2 class="inline-block"><%= t("admin.emails_download.index.title") %></h2>
|
|
|
|
<div class="small-6">
|
|
<%= form_tag generate_csv_admin_emails_download_index_path,
|
|
method: :get,
|
|
id: "admin_download_emails" do %>
|
|
|
|
<label><%= t("admin.emails_download.index.download_segment") %></label>
|
|
<p class="help-text" id="emails-help-text">
|
|
<%= t("admin.emails_download.index.download_segment_help_text") %>
|
|
</p>
|
|
|
|
<%= select_tag :users_segment, options_for_select(user_segments_options) %>
|
|
|
|
<%= submit_tag t("admin.emails_download.index.download_emails_button"),
|
|
class: "button",
|
|
data: { disable_with: false } %>
|
|
<% end %>
|
|
</div>
|