Permalink
Browse files

move previewed/posted comment outside of <form>, fixes duplicate comm…

…ent problem

a comment would get posted and then displayed inside the original
<form>.  when that comment would get edited, its <form> would be
nested inside the original one, and on webkit browsers, submitting
the inside form would submit the outside one.
  • Loading branch information...
jcs committed Sep 4, 2012
1 parent 6ae36ea commit 17ce13d49ea0bbc03037bb59485ca3d827f6e8ee
Showing with 9 additions and 10 deletions.
  1. +9 −10 app/views/comments/_commentbox.html.erb
@@ -30,16 +30,15 @@
</div>
<p></p>
<% if defined?(show_comment) %>
<% if show_comment.valid? %>
<ol class="comments comments1 preview">
<%= render :partial => "comments/comment",
:locals => { :comment => show_comment, :story => story } %>
</ol>
<% else %>
<%= errors_for comment %>
<% end %>
<% end %>
<% if defined?(show_comment) %>
<% if show_comment.valid? %>
<ol class="comments comments1 preview">
<%= render :partial => "comments/comment",
:locals => { :comment => show_comment, :story => story } %>
</ol>
<% else %>
<%= errors_for comment %>
<% end %>
<% end %>
</div>

0 comments on commit 17ce13d

Please sign in to comment.