KatanaCode/blogit

View on GitHub
app/views/blogit/comments/create.js.erb

Summary

Maintainability
Test Coverage
var $form = $("form.blogit_form");
<% if @comment.save %>
  $(".blogit_comments_list").append("<%= escape_javascript(render(@comment)) %>");
  $form.get(0).reset();
<% else %>
  $form.html("<%= escape_javascript(render(partial:'form', locals: { post: @comment.post, comment: @comment })) %>");
<% end %>