<%= render partial: 'commontator/threads/show', locals: { thread: @thread, user: @user, page: @thread.new_comment_page(@per_page), per_page: @per_page } %> <% unless @new_comment.nil? %> $("#thread_<%= @thread.id %>_new_comment_form_div").html("<%= escape_javascript( render partial: 'form', locals: { comment: @new_comment, thread: @thread, per_page: @per_page }) %>"); <% else %> $("#thread_<%= @thread.id %>_new_comment_form_div").hide(); $("#thread_<%= @thread.id %>_new_comment_link_div").fadeIn(); <% end %> $("#comment_<%= @comment.id.to_s %>_div").hide().fadeIn()[0].scrollIntoView(); <%= javascript_proc %>