$('#no_comments').fadeOut()
<% if @reply %>
  if($('#comment_<%= @comment.commentable_id %> ul').length == 0)
    $('#comment_<%= @comment.commentable_id %>').append('<ul id="comment_<%= @comment.commentable_id %>_replies" class="replies"></ul>')
  $('#comment_<%= @comment.commentable_id %>_replies').append("<%= escape_javascript( render @comment, :locals => {:reply => @reply} ) %>")
  $('#commentable_id').val('<%= @comment.commentable.commentable_id %>')
  $('#commentable_type').val('<%= @comment.commentable.commentable_type %>')
<% else %>
  $('#comments').prepend("<%= escape_javascript( render @comment, :locals => {:reply => @reply} ) %>")
<% end %>


$('#no_comments').fadeOut()
<% if @comment.valid? %>
  <% if @reply %>
    if($('#comment_<%= @comment.commentable_id %> ul').length == 0)
      $('#comment_<%= @comment.commentable_id %>').append('<ul id="comment_<%= @comment.commentable_id %>_replies" class="replies"></ul>')
    $('#comment_<%= @comment.commentable_id %>_replies').append("<%= escape_javascript( render @comment, :locals => {:reply => @reply} ) %>")
    $('#commentable_id').val('<%= @comment.commentable.commentable_id %>')
    $('#commentable_type').val('<%= @comment.commentable.commentable_type %>')
  <% else %>
    $('#comments').prepend("<%= escape_javascript( render @comment, :locals => {:reply => @reply} ) %>")
  <% end %>
<% else %>
  jQuery('#comments').prepend("<%= escape_javascript(flash[:notice]) %>");
  jQuery('#comments').prepend("<%= escape_javascript(flash[:error]) %>");
<% end %>

Return error to user if couldn't save the comment
Return error to user if couldn't save the comment
