<% @thread.comments.each do |comment| %> $("#comment_<%= comment.id.to_s %>_actions_span").html("<%= escape_javascript( render :partial => 'actions', :locals => {:comment => comment}) %>"); <% end %> $("#thread_<%= @thread.id %>_comment_list_div").append("<%= escape_javascript( render :partial => 'show', :locals => {:comment => @comment}) %>"); $("#thread_<%= @thread.id %>_new_comment_div").hide(); $("#thread_<%= @thread.id %>_new_comment_link_span").show(); <%= javascript_proc %>