Skip to content

Commit 17ce13d

Browse files
committed
move previewed/posted comment outside of <form>, fixes duplicate comment 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.
1 parent 6ae36ea commit 17ce13d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

app/views/comments/_commentbox.html.erb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@
3030
</div>
3131

3232
<p></p>
33-
34-
<% if defined?(show_comment) %>
35-
<% if show_comment.valid? %>
36-
<ol class="comments comments1 preview">
37-
<%= render :partial => "comments/comment",
38-
:locals => { :comment => show_comment, :story => story } %>
39-
</ol>
40-
<% else %>
41-
<%= errors_for comment %>
42-
<% end %>
33+
<% end %>
34+
<% if defined?(show_comment) %>
35+
<% if show_comment.valid? %>
36+
<ol class="comments comments1 preview">
37+
<%= render :partial => "comments/comment",
38+
:locals => { :comment => show_comment, :story => story } %>
39+
</ol>
40+
<% else %>
41+
<%= errors_for comment %>
4342
<% end %>
4443
<% end %>
4544
</div>

0 commit comments

Comments
 (0)