<% if @comment.new_record? %>
  $("#ajax-modal > form").prepend("<%=j error_messages_for(@comment) %>");
<% else %>
  hideModal();
  $("#<%=j params[:element_to_update] || 'comments' %>").append("<%=j render(:partial => 'common/comment', :locals => {:comment => @comment, :entity => @comment.commented}) -%>")
<% end %>
