<%= render partial: 'commontator/threads/show', locals: { thread: @commontator_thread, user: @commontator_user, per_page: @commontator_per_page, page: @commontator_thread.new_comment_page(@commontator_per_page), show_all: @commontator_show_all } %> <% unless @commontator_new_comment.nil? %> $("#commontator-thread-<%= @commontator_thread.id %>-new-comment").html("<%= escape_javascript( render partial: 'form', locals: { comment: @commontator_new_comment, thread: @commontator_thread, per_page: @commontator_per_page } ) %>"); <% else %> $("#commontator-thread-<%= @commontator_thread.id %>-new-comment").hide(); $("#commontator-thread-<%= @commontator_thread.id %>-new-comment-link").fadeIn(); <% end %> $("#commontator-comment-<%= @comment.id %>").hide().fadeIn()[0].scrollIntoView(); <%= javascript_proc %>