Files
nairobi/app/views/comments/create.js.erb
Javi Martín 3e4e65ead7 Use double quotes inside ERB
We were using single quotes inside ERB code when that code was inside
HTML double quotes.
2019-03-25 14:58:54 +01:00

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 -%>