スパン クラス内のコンテンツを jquery に置き換えようとしています。最初の行が機能するため、jquery ファイルが読み取られていることがわかります。基本的に、jquery の最初の行は、通知のリストに新しい通知を追加します。クエリの 2 行目は、サイトの既存の番号を新しい @unseen_notifications.count に置き換える必要があります。jquery ファイルの 2 行目が機能していません。どうすれば修正できますか?
jquery:
$('#user_notifications').prepend("<%= j render(@user_notifications) %>");
$('#red-count').html.replaceWith("<%= @unseen_notifications.count %>");
html:
<span class="red-count">
<%= @unseen_notifications.count %>
</span>