data
配列のオブジェクトとmark_read
メソッドがあり、これはPUT
リクエストを私のRailsアプリケーションに送信します。それはのdata
のオプションはオブジェクトインスタンスではないように見えますが、どうすれば修正できますか?このコンテキストのajaxデータオプション
Notifications.prototype = {
constructor: Notifications,
...
mark_read: function() {
$.ajax({
method: "PUT",
url: '/notifications/mark_read',
data: this.data.slice(0,5)
});
}
...
}
あなたは何を期待していますか?データはどこに定義されていますか? – matmo