From b56d7bdfa82ceab05287e2ab35e4ecc09b0887cf Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 7 Oct 2014 13:52:28 -0500 Subject: [PATCH] Disable comment submit button to prevent double posting. --- app/views/comments/partials/new/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/comments/partials/new/_form.html.erb b/app/views/comments/partials/new/_form.html.erb index 23e0b675b..1b649f3a5 100644 --- a/app/views/comments/partials/new/_form.html.erb +++ b/app/views/comments/partials/new/_form.html.erb @@ -4,7 +4,7 @@ <%= form_tag(comments_path, :class => "simple_form") do %> <%= hidden_field "comment", "post_id", :value => post.id %> <%= dtext_field "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %> - <%= submit_tag "Post" %> + <%= submit_tag "Post", :data => { :disable_with => "Submitting..." } %> <%= dtext_preview_button "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %> <%= check_box "comment", "do_not_bump_post", :id => "comment_do_not_bump_post_#{post.id}" %> <% end %>