From 17ce13d49ea0bbc03037bb59485ca3d827f6e8ee Mon Sep 17 00:00:00 2001 From: joshua stein Date: Tue, 4 Sep 2012 11:33:49 -0500 Subject: [PATCH] move previewed/posted comment outside of
, fixes duplicate comment problem a comment would get posted and then displayed inside the original . when that comment would get edited, its would be nested inside the original one, and on webkit browsers, submitting the inside form would submit the outside one. --- app/views/comments/_commentbox.html.erb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/views/comments/_commentbox.html.erb b/app/views/comments/_commentbox.html.erb index 52f6668..af3095c 100644 --- a/app/views/comments/_commentbox.html.erb +++ b/app/views/comments/_commentbox.html.erb @@ -30,16 +30,15 @@

- - <% if defined?(show_comment) %> - <% if show_comment.valid? %> -
    - <%= render :partial => "comments/comment", - :locals => { :comment => show_comment, :story => story } %> -
- <% else %> - <%= errors_for comment %> - <% end %> +<% end %> +<% if defined?(show_comment) %> + <% if show_comment.valid? %> +
    + <%= render :partial => "comments/comment", + :locals => { :comment => show_comment, :story => story } %> +
+ <% else %> + <%= errors_for comment %> <% end %> <% end %>