We were using single quotes inside ERB code when that code was inside HTML double quotes.
12 lines
409 B
Plaintext
12 lines
409 B
Plaintext
var comment_html = "<%= j(render @comment) %>"
|
|
|
|
<% if @comment.root? -%>
|
|
var commentable_id = "<%= dom_id(@commentable) %>";
|
|
App.Comments.reset_form(commentable_id);
|
|
App.Comments.add_comment(commentable_id, comment_html);
|
|
<% else -%>
|
|
var parent_id = "<%= "comment_#{@comment.parent_id}" %>";
|
|
App.Comments.reset_and_hide_form(parent_id);
|
|
App.Comments.add_reply(parent_id, comment_html);
|
|
<% end -%>
|